DesignModeValueProvider 构造函数

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

初始化 DesignModeValueProvider 类的新实例。

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

语法

声明
Public Sub New
public DesignModeValueProvider()
public:
DesignModeValueProvider()
new : unit -> DesignModeValueProvider
public function DesignModeValueProvider()

异常

异常 条件
InvalidOperationException

将无效属性添加到 Properties

备注

在该构造函数中标识要捕获的属性。 通过将这些属性添加到 Properties 来标识这些属性。

示例

下面的示例将 BackgroundContent 属性标识为要捕获的属性。 当用户更改这些属性时,新值由 TranslatePropertyValue 方法提供。 此代码示例摘自为 DesignModeValueProvider 类提供的一个更大的示例。

有关更多信息,请参见 演练:在设计时更改属性的行为


Public Sub New()
    Properties.Add(GetType(Button), "Content")
    Properties.Add(GetType(Button), "Background")
End Sub

public CustomButtonDesignModeValueProvider()
{
    Properties.Add( typeof(Button), "Content");
    Properties.Add(typeof(Button), "Background");
}

.NET Framework 安全性

请参见

参考

DesignModeValueProvider 类

Microsoft.Windows.Design.Model 命名空间

其他资源

如何:在设计时更改属性的行为

WPF 设计器扩展性体系结构

属性编辑体系结构

功能提供程序和功能连接器