如何在 WPF 中创建数据绑定(bind)、项目符号的超链接列表?
我有这个:
<ItemsControl Name="lstScripts">
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBlock>
<Hyperlink>
<TextBlock Text="{Binding Path=Name}" />
</Hyperlink>
</TextBlock>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
但我不知道如何将这些元素变成子弹。我看到 BulletDecorator,但我不想指定自己的项目符号图像,我只想要标准项目符号。
最佳答案
不幸的是,没有“标准项目符号”......这是一个简单的椭圆项目符号的示例:
<ItemsControl Name="lstScripts">
<ItemsControl.ItemTemplate>
<DataTemplate>
<BulletDecorator Width="Auto">
<BulletDecorator.Bullet>
<Ellipse Fill="White" Stroke="Black" StrokeThickness="1" Width="8" Height="8"/>
</BulletDecorator.Bullet>
<TextBlock>
<Hyperlink>
<TextBlock Text="{Binding Path=Name}" />
</Hyperlink>
</TextBlock>
</BulletDecorator>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
关于WPF 数据绑定(bind)项目符号列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/870277/