BulletDecorator.Bullet 屬性

定義

取得或設定 BulletDecorator 物件中做為項目符號的物件。

public:
 property System::Windows::UIElement ^ Bullet { System::Windows::UIElement ^ get(); void set(System::Windows::UIElement ^ value); };
public System.Windows.UIElement Bullet { get; set; }
member this.Bullet : System.Windows.UIElement with get, set
Public Property Bullet As UIElement

屬性值

要當做項目符號使用的 UIElement 物件。 預設為 null

範例

下列範例示範如何設定 Bullet 屬性。

BulletDecorator bp = new BulletDecorator();
Image i = new Image();
BitmapImage bi= new BitmapImage(); 
bi.UriSource = new Uri(@"pack://application:,,/images/icon.jpg");
i.Source = bi;
i.Width = 10;
bp.Bullet = i;
TextBlock tb = new TextBlock();
tb.Text = "My Expander";
tb.Margin = new Thickness(20,0,0,0);     
bp.Child = tb;
Dim bp As BulletDecorator = New BulletDecorator()
Dim i As Image = New Image()
Dim bi As BitmapImage = New BitmapImage()
bi.UriSource = New Uri("pack://application:,,./images/icon.jpg")
i.Source = bi
i.Width = 10
bp.Bullet = i
Dim tb As TextBlock = New TextBlock()
tb.Text = "My Expander"
tb.Margin = New Thickness(20, 0, 0, 0)
bp.Child = tb
<BulletDecorator>
  <BulletDecorator.Bullet>
    <Image Width="10" Source="images\icon.jpg"/>
  </BulletDecorator.Bullet>
  <TextBlock Margin="20,0,0,0">My Expander</TextBlock>
</BulletDecorator>

備註

屬性 Bullet 是 控制項的內容屬性 BulletDecorator ,並定義 UIElement 要顯示為 物件的專案符號 Child

藉由將 Bullet 屬性設定為 UIElement 來定義的專案符號是 控制項中的第一個 BulletDecorator 視覺專案。 單一 Child 元素是第二個視覺元素。

XAML 屬性項目用法

<object>  
  <object.Bullet>  
    <UIElement .../>  
  </object.Bullet>  
</object>  

適用於

另請參閱