AdornerColors.RailFillBrushKey 属性

[本文档仅供预览,在以后的发行版中可能会发生更改。包含的空白主题用作占位符。]

获取用于绘制围栏的画笔的资源键。

命名空间:  Microsoft.Windows.Design.Interaction
程序集:  Microsoft.Windows.Design.Interaction(在 Microsoft.Windows.Design.Interaction.dll 中)

语法

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

属性值

类型:System.Windows.ResourceKey
AdornerResources 字典中的一个 ResourceKey,它表示用于在 WPF Designer 中绘制围栏的标准画笔。

备注

使用 ResourceKeyAdornerResources 字典检索相应 Brush

示例

下面的代码示例演示如何使用 AdornerResources 类将 CheckBox 控件的 Background 设置为 RailFillBrushKey 指定的颜色。 有关更多信息,请参见演练:在设计时调试 WPF 自定义控件

' 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 安全性

请参见

参考

AdornerColors 类

Microsoft.Windows.Design.Interaction 命名空间

AdornerResources

AdornerPanel

AdornerFonts

PrimarySelectionAdornerProvider

其他资源

演练:创建设计时装饰器

演练:在控件内部实现一个轨道

演练:在设计时调试 WPF 自定义控件

装饰器体系结构