[英]How do I add a bullet point in front of a text binding in wpf?
I have the following abbreviated for simplicity 为简单起见,我有以下缩写
<ItemsControl ItemSource="{Binding enumerableList}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBox Text="{Binding displayName, Mode=OneWay}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
How can I get it so that my TextBox shows a bullet point in front of the text bound to it? 我怎样才能得到它以便我的TextBox在绑定到它的文本前面显示一个子弹点? Desired format: 所需格式:
You can use the BulletDecorator
with the TextBlock. 您可以将BulletDecorator
与TextBlock一起使用。 Example: 例:
<BulletDecorator>
<BulletDecorator.Bullet>
<Ellipse Height="10" Width="10" Fill="Blue"/>
</BulletDecorator.Bullet>
<TextBox Text="{Binding displayName, Mode=OneWay}" />
</BulletDecorator>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.