I just need a simple list of items with bullets preceding them. How can I do this? I can't find any control that does this I can use grids and such to accomplish this, but it seems like so much work for something so simple
Just insert the bullet character directly into your XAML:
<StackPanel>
<TextBlock Text="• Item 1"/>
<TextBlock Text="• Item 2"/>
</StackPanel>
You can also use the Hex HTML entity:
<TextBlock>• Item 1</TextBlock>
If the items come from a viewmodel / binding, then use an ItemsControl
:
<ItemsControl ItemsSource="{Binding MyItems}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding StringFormat='• {0}'}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
Footnote: Not relevant to Silverlight/Windows Phone, but WPF has BulletDecorator - example.
I used a stackpanel with bulletdecorators to show a bullet list:
<StackPanel>
<BulletDecorator>
<BulletDecorator.Bullet>
<Rectangle Width="5" Height="5" Fill="Gray" />
</BulletDecorator.Bullet>
<TextBlock Margin="20,0,0,0">Step 1: test</TextBlock>
</BulletDecorator>
<BulletDecorator>
<BulletDecorator.Bullet>
<Rectangle Width="5" Height="5" Fill="Gray" />
</BulletDecorator.Bullet>
<TextBlock Margin="20,0,0,0">Step 2: test</TextBlock>
</BulletDecorator>
</StackPanel>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With