Share via


AdornerProvider.Adorners Property

Gets the collection of adorners that are provided by this adorner provider.

Namespace:  Microsoft.Windows.Design.Interaction
Assembly:  Microsoft.Windows.Design.Extensibility (in Microsoft.Windows.Design.Extensibility.dll)

Syntax

'Declaration
Public ReadOnly Property Adorners As Collection(Of UIElement)
'Usage
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>

Property Value

Type: System.Collections.ObjectModel.Collection<UIElement>
A collection of UIElement objects that have adorner attached properties.

Remarks

The Adorners collection is populated in your Activate implementation.

Examples

The following code example shows how to add an adorner panel to the Adorners collection. For more information, see Walkthrough: Creating a Design-time Adorner.

' 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;
    } 
}

.NET Framework Security

See Also

Reference

AdornerProvider Class

AdornerProvider Members

Microsoft.Windows.Design.Interaction Namespace

Other Resources

Adorner Architecture

Layout Space and Render Space

Feature Providers and Feature Connectors

Walkthrough: Creating a Design-time Adorner