BulletDecorator Class

Represents a layout control that aligns a bullet and another visual object.

Namespace:  System.Windows.Controls.Primitives
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

Public Class BulletDecorator _
	Inherits Decorator
Dim instance As BulletDecorator

Content Model: BulletDecorator is a Decorator element and has two content properties: Bullet and Child. The Bullet property defines the UIElement to use as a bullet. The Child property defines a UIElement that visually aligns with the bullet.

A Bullet always aligns with the first line of text when the Child object is a TextBlock. If the Child object is not a TextBlock, the Bullet aligns to the center of the Child object. For more information about layout of a BulletDecorator, see How to: Create a BulletDecorator.

The following illustration shows examples of BulletDecorator controls.

3 BulletDecorators: CheckBox, RadioButton, TextBox

The following examples show how to define a BulletDecorator control.

Dim myBulletDecorator = New BulletDecorator()
Dim myImage = New Image()
Dim myBitmapImage = New BitmapImage()
myBitmapImage.UriSource = _
   New Uri("pack://application:,,/images/apple.jpg")
myImage.Source = myBitmapImage
myImage.Width = 10
myBulletDecorator.Bullet = myImage
myBulletDecorator.Margin = New Thickness(0, 10, 0, 0)
myBulletDecorator.VerticalAlignment = VerticalAlignment.Center
myBulletDecorator.Background = Brushes.Yellow
Dim myTextBlock = New TextBlock()
myTextBlock.Text = "This BulletDecorator created by using code"
myTextBlock.TextWrapping = TextWrapping.Wrap
myTextBlock.HorizontalAlignment = HorizontalAlignment.Left
myTextBlock.Width = 100
myTextBlock.Foreground = Brushes.Purple
myBulletDecorator.Child = myTextBlock
<BulletDecorator  Grid.Row="1" Grid.Column="0" Margin="0,5,0,0"
                  VerticalAlignment="Center" Background="Yellow">
    <Image Source="images\apple.jpg"/>
    Foreground ="Purple">
    A Simple BulletDecorator


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft