XAML BulletPanel
XAML Bullet Panel is used to draw a bulleted list of items. These items can be text, controls, or even graphics objects. In this article I will discuss how to use XAML Bullet Panel.
XAML Bullet Panel is used to draw a bulleted list of items. These items can be text, controls, or even graphics objects. In this article I will discuss how to use XAML Bullet Panel.
The code listed in Listing 1 shows how to create bullet panels and list XAML controls in a bullted form.
<Window xmlns="http://schemas.microsoft.com/winfx/avalon/2005"
xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005">
<StackPanel>
<TextBlock FontSize="18" FontFamily="Verdana" FontStyle="Oblique" Margin="10,10,0,10">Select a Site</TextBlock>
<BulletPanel Margin="10,2,0,10">
<RadioButton>C# Corner</RadioButton>
</BulletPanel>
<BulletPanel Margin="10,2,0,10">
<RadioButton>VB.NET Heaven</RadioButton>
</BulletPanel>
<BulletPanel Margin="10,2,0,10">
<RadioButton>Longhorn Corner</RadioButton>
</BulletPanel>
<TextBlock FontSize="18" FontFamily="Verdana" FontStyle="Italic" Margin="10,10,0,10">Select Features</TextBlock>
<BulletPanel Margin="10,2,0,10">
<CheckBox>I want newsletter</CheckBox>
</BulletPanel>
<BulletPanel Margin="10,2,0,10">
<CheckBox>Product Reviews</CheckBox>
</BulletPanel>
<BulletPanel Margin="10,2,0,10">
<CheckBox>New Features</CheckBox>
</BulletPanel>
</StackPanel>
</Window>
|
Listing 1. Putting XAML controls in a bulleted list
The output of Listing 1 looks like Figure 1.
Figure 1. Using BulletPanel to list XAML controls
You can even put graphics objects in a bulleted list using bullet pane. See Listing 2.
<BulletPanel Margin="10,2,0,10">
<Ellipse Height="100" Width="100" StrokeThickness="5" Stroke="black" Fill="gold"/>
</BulletPanel>
<BulletPanel Margin="10,0,50,10">
<Rectangle Fill="Yellow" Width="100" Height="100" Stroke="Blue" StrokeThickness="5" />
</BulletPanel>
|
Listing 2. Putting graphics objects in a bulleted list
The output of Listing 1 looks like Figure 2.
Figure 2. Graphics objects in a bulleted list
Ask Your Question
Got a programming related question? You may want to post your question here