Share via


AdornerProvider Constructor

Initializes a new instance of the AdornerProvider class.

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

Syntax

'Declaration
Protected Sub New
protected AdornerProvider()
protected:
AdornerProvider()
new : unit -> AdornerProvider
protected function AdornerProvider()

Remarks

The constructor provides an appropriate location for initializing the controls which make up the adorners.

Examples

The following code example shows how to initialize a CheckBox control for use as an adorner. For more information, see Walkthrough: Debugging WPF Custom Controls at Design Time.

' The constructor sets up the adorner control. 
Public Sub New()
    autoSizeCheckBox = New CheckBox()
    autoSizeCheckBox.Content = "AutoSize"
    autoSizeCheckBox.IsChecked = True
    autoSizeCheckBox.FontFamily = AdornerFonts.FontFamily
    autoSizeCheckBox.FontSize = AdornerFonts.FontSize
    autoSizeCheckBox.Background = CType( _
        AdornerResources.FindResource(AdornerColors.RailFillBrushKey),  _
        Brush)
End Sub
// The constructor sets up the adorner control. 
public AutoSizeAdornerProvider()
{
    autoSizeCheckBox = new CheckBox();
    autoSizeCheckBox.Content = "AutoSize";
    autoSizeCheckBox.IsChecked = true;
    autoSizeCheckBox.FontFamily = AdornerFonts.FontFamily;
    autoSizeCheckBox.FontSize = AdornerFonts.FontSize;
    autoSizeCheckBox.Background = AdornerResources.FindResource(
        AdornerColors.RailFillBrushKey) as Brush;
}

.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