共用方式為


AdornerProvider.Adorners 屬性

更新:2007 年 11 月

取得這個裝飾項提供者所提供的裝飾項集合。

命名空間:  Microsoft.Windows.Design.Interaction
組件:  Microsoft.Windows.Design.Extensibility (在 Microsoft.Windows.Design.Extensibility.dll 中)

語法

Public ReadOnly Property Adorners As Collection(Of UIElement)

Dim instance As AdornerProvider
Dim value As Collection(Of UIElement)

value = instance.Adorners
public Collection<UIElement> Adorners { get; }
public:
property Collection<UIElement^>^ Adorners {
    Collection<UIElement^>^ get ();
}
public function get Adorners () : Collection<UIElement>

屬性值

型別:System.Collections.ObjectModel.Collection<UIElement>

UIElement 物件的集合,其中包含裝飾項附加屬性。

備註

在您的 Activate 實作中,會填入 Adorners 集合。

範例

在下列程式碼範例中,會說明如何將裝飾項面板加入至 Adorners 集合。如需詳細資訊,請參閱逐步解說:建立設計階段裝飾項

' The Panel utility property demand-creates the 
' adorner panel and adds it to the provider's 
' Adorners collection.
Public ReadOnly Property Panel() As AdornerPanel
    Get
        If Me.opacitySliderAdornerPanel Is Nothing Then
            Me.opacitySliderAdornerPanel = New AdornerPanel()

            ' Add the adorner to the adorner panel.
            Me.opacitySliderAdornerPanel.Children.Add(opacitySlider)

            ' Add the panel to the Adorners collection.
            Adorners.Add(opacitySliderAdornerPanel)
        End If

        Return Me.opacitySliderAdornerPanel
    End Get
End Property
// The Panel utility property demand-creates the 
// adorner panel and adds it to the provider's 
// Adorners collection.
public AdornerPanel Panel 
{ 
    get
    {
        if (this.opacitySliderAdornerPanel == null)
        {
            opacitySliderAdornerPanel = new AdornerPanel();

            opacitySliderAdornerPanel.Children.Add(opacitySlider);

            // Add the panel to the Adorners collection.
            Adorners.Add(opacitySliderAdornerPanel);
        }

        return this.opacitySliderAdornerPanel;
    } 
}

使用權限

請參閱

參考

AdornerProvider 類別

AdornerProvider 成員

Microsoft.Windows.Design.Interaction 命名空間

其他資源

裝飾項架構

配置空間和轉譯空間

功能提供者和功能連接器

逐步解說:建立設計階段裝飾項