在这里,我有一个页面上的资源。
我希望通过使用DynamicResource来本地化我的应用程序,因此,我的TextBlock的Text属性引用了这个DynamicResource。
<Page.Resources>
<sys:String x:Key="textBlock1">Hello
The world</sys:String>
</Page.Resources>
我希望通过使用DynamicResource来本地化我的应用程序,因此,我的TextBlock的Text属性引用了这个DynamicResource。
<TextBlock Text="{DynamicResource textBlock1}" Margin="105,163,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
我更喜欢在第一行使用“Hello”这个词,在第二行使用“世界”,因此我使用“ ”来实现,但它被视为一个空格。
如果我直接将字符串“Hello The world”分配给TextBlock.Text
<TextBlock Text="Hello
The world" Margin="105,163,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
正确地断开 IT。
那么,如何在 DynamicResource 中断开字符串?
code
xml:space="preserve"code
。有没有更好的方法通知每个资源保留其空格? - RambleInX