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 命名空间

其他资源

装饰器体系结构

布局空间和呈现空间

功能提供程序和功能连接器

演练:创建设计时装饰器