ModelService.CreateStaticMemberItem 方法

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

在派生类中重写时,创建一个表示指定类的静态成员的值的新模型项。

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

语法

声明
Protected MustOverride Function CreateStaticMemberItem ( _
    type As Type, _
    memberName As String _
) As ModelItem
protected abstract ModelItem CreateStaticMemberItem(
    Type type,
    string memberName
)
protected:
virtual ModelItem^ CreateStaticMemberItem(
    Type^ type, 
    String^ memberName
) abstract
abstract CreateStaticMemberItem : 
        type:Type * 
        memberName:string -> ModelItem 
protected abstract function CreateStaticMemberItem(
    type : Type, 
    memberName : String
) : ModelItem

参数

  • type
    类型:System.Type
    包含所引用的静态成员的类型。
  • memberName
    类型:System.String
    所引用的静态成员的名称。

返回值

类型:Microsoft.Windows.Design.Model.ModelItem
一个表示 type 的静态成员的新建模型项。

备注

CreateStaticMemberItem 方法新建一个表示 type 的静态成员值的模型项。 例如,若要在模型中添加对 Brushes.Red 的引用,应使用 typeof(Brushes) 和字符串“Red”调用此方法。 此项序列化至以下 XAML 中。

[xaml]

{x:Static Brushes.Red}

.NET Framework 安全性

请参见

参考

ModelService 类

Microsoft.Windows.Design.Services 命名空间

ModelItem

ViewService

DesignerView

ContextItemManager

其他资源

编辑模型体系结构

WPF 设计器扩展性