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.Interaction (in Microsoft.Windows.Design.Interaction.dll)

Syntax

'Declaration
Public ReadOnly Property Adorners As Collection(Of UIElement)
    Get
public Collection<UIElement> Adorners { get; }
public:
property Collection<UIElement^>^ Adorners {
    Collection<UIElement^>^ get ();
}
member Adorners : Collection<UIElement>
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

Microsoft.Windows.Design.Interaction Namespace

Other Resources

Adorner Architecture

Feature Providers and Feature Connectors

Walkthrough: Creating a Design-time Adorner