AdornerColors Class
Provides a set of common brushes that can be used on adorners.
Namespace: Microsoft.Windows.Design.Interaction
Assembly: Microsoft.Windows.Design.Interaction (in Microsoft.Windows.Design.Interaction.dll)
Syntax
'Declaration
Public NotInheritable Class AdornerColors
'Usage
You do not need to declare an instance of a static class in order to access its members.
public static class AdornerColors
public ref class AdornerColors abstract sealed
public final class AdornerColors
Remarks
Use the AdornerColors class to standardize the appearance of your custom adorner controls. By using this pre-defined set of colors, your custom adorners participate in the color scheme of the WPF Designer.
Examples
The following code example shows how to use the AdornerColors class to set the Background of a Slider control to a standard adorner color. For more information, see Walkthrough: Implementing a Rail Inside a Control.
' Set the slider's background to the rail fill color.
skewSlider.Background = AdornerColors.RailFillBrush
// Set the slider's background to the rail fill color.
skewSlider.Background = AdornerColors.RailFillBrush;
The following code example shows how to use the AdornerResources class to set the Background of a CheckBox control to a standard adorner color. 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;
}
Inheritance Hierarchy
System.Object
Microsoft.Windows.Design.Interaction.AdornerColors
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also
Reference
Microsoft.Windows.Design.Interaction Namespace
PrimarySelectionAdornerProvider
Other Resources
Walkthrough: Creating a Design-time Adorner
Walkthrough: Implementing a Rail Inside a Control