ModelFactory.CreateItem 方法 (EditingContext, TypeIdentifier, CreateOptions, array<Object )

为指定的类型标识符创建一个新的模型项。

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

语法

声明
Public Shared Function CreateItem ( _
    context As EditingContext, _
    typeIdentifier As TypeIdentifier, _
    options As CreateOptions, _
    ParamArray arguments As Object() _
) As ModelItem
public static ModelItem CreateItem(
    EditingContext context,
    TypeIdentifier typeIdentifier,
    CreateOptions options,
    params Object[] arguments
)
public:
static ModelItem^ CreateItem(
    EditingContext^ context, 
    TypeIdentifier typeIdentifier, 
    CreateOptions options, 
    ... array<Object^>^ arguments
)
static member CreateItem : 
        context:EditingContext * 
        typeIdentifier:TypeIdentifier * 
        options:CreateOptions * 
        arguments:Object[] -> ModelItem 
public static function CreateItem(
    context : EditingContext, 
    typeIdentifier : TypeIdentifier, 
    options : CreateOptions, 
    ... arguments : Object[]
) : ModelItem

参数

  • arguments
    类型:array<System.Object[]
    一个应传递给该项的构造函数的可选参数数组。

返回值

类型:Microsoft.Windows.Design.Model.ModelItem
一个 ModelItem,表示新建的项类型。如果未能解析该类型标识符,则此方法可能会返回 nullnull 引用(在 Visual Basic 中为 Nothing)。

异常

异常 条件
ArgumentNullException

context 为 nullnull 引用(在 Visual Basic 中为 Nothing)。

.NET Framework 安全性

请参见

参考

ModelFactory 类

CreateItem 重载

Microsoft.Windows.Design.Model 命名空间

其他资源

WPF 设计器扩展性

编辑模型体系结构