Share via


AdornerColors.RailFillBrushKey Property

Gets a resource key for the brush used for rails.

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

Syntax

'Declaration
Public Shared ReadOnly Property RailFillBrushKey As ResourceKey
    Get
public static ResourceKey RailFillBrushKey { get; }
public:
static property ResourceKey^ RailFillBrushKey {
    ResourceKey^ get ();
}
static member RailFillBrushKey : ResourceKey
static function get RailFillBrushKey () : ResourceKey

Property Value

Type: System.Windows.ResourceKey
A ResourceKey for the AdornerResources dictionary representing the standard brush for rails in the WPF Designer.

Remarks

Use the ResourceKey to retrieve the corresponding Brush from the AdornerResources dictionary.

Examples

The following code example shows how to use the AdornerResources class to set the Background of a CheckBox control to the color specified by RailFillBrushKey. 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

AdornerColors Class

Microsoft.Windows.Design.Interaction Namespace

AdornerResources

AdornerPanel

AdornerFonts

PrimarySelectionAdornerProvider

Other Resources

Walkthrough: Creating a Design-time Adorner

Walkthrough: Implementing a Rail Inside a Control

Walkthrough: Debugging WPF Custom Controls at Design Time

Adorner Architecture