有没有办法\n让一个换行TextBlock?
<TextBlock Text="line1\nLine2" />
Run Code Online (Sandbox Code Playgroud)
或者是否有更好的方法来强制中间线中断,在Text属性中?
<LineBreak />
Run Code Online (Sandbox Code Playgroud)
这对我不起作用,它必须是Text属性的值,因为文本字符串是从外部源设置的.
我很熟悉,LineBreak但这不是我正在寻找的答案.
我有一个带有以下用户控件的XBAP应用程序:
<UserControl x:Class="XXX.UsersGrid"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="Auto" Width="Auto">
<UserControl.Resources>
<DataTemplate x:Key="UpArrowUsers">
<DockPanel>
<TextBlock Text="xxUser" x:Name="upArrowUsersHeader" HorizontalAlignment="Center"></TextBlock>
<Path x:Name="arrow" StrokeThickness = "1" Fill= "gray" Data= "M 5,10 L 15,10 L 10,5 L 5,10"/>
</DockPanel>
</DataTemplate>
</UserControl>
...
Run Code Online (Sandbox Code Playgroud)
现在我想从resx文件中获取字符串"xxUser",该文件作为资源嵌入到应用程序中我该如何实现?
我有一个字符串列表,ViewModel格式如下:
This is an <b>example.<b>
Run Code Online (Sandbox Code Playgroud)
我希望在我的视图中有一些文本控件,它将通过DataBinding*显示格式化文本,如下所示:
这是一个例子.
我找不到任何可以表现得像这样的内置控件.
有谁知道如何处理它?