AdornerFonts 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 AdornerFonts
'Usage
You do not need to declare an instance of a static class in order to access its members.
public static class AdornerFonts
public ref class AdornerFonts abstract sealed
public final class AdornerFonts
Remarks
Use the AdornerFonts class to standardize the appearance of your custom adorner controls. By using this pre-defined font family and size, your custom adorners participate in the color scheme of the WPF Designer.
Examples
The following code example shows how to use the AdornerFonts class to set the font family and size of a CheckBox control. 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.AdornerFonts
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