ModelService.CreateItem 方法 (Type, CreateOptions, array<Object )

在派生类中重写时,为指定的类型创建 ModelItem 对象。

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

语法

声明
Protected MustOverride Function CreateItem ( _
    itemType As Type, _
    options As CreateOptions, _
    ParamArray arguments As Object() _
) As ModelItem
protected abstract ModelItem CreateItem(
    Type itemType,
    CreateOptions options,
    params Object[] arguments
)
protected:
virtual ModelItem^ CreateItem(
    Type^ itemType, 
    CreateOptions options, 
    ... array<Object^>^ arguments
) abstract
abstract CreateItem : 
        itemType:Type * 
        options:CreateOptions * 
        arguments:Object[] -> ModelItem 
protected abstract function CreateItem(
    itemType : Type, 
    options : CreateOptions, 
    ... arguments : Object[]
) : ModelItem

参数

  • itemType
    类型:System.Type
    要创建的项类型。
  • arguments
    类型:array<System.Object[]
    要传递到该项的构造函数的参数数组。

返回值

类型:Microsoft.Windows.Design.Model.ModelItem
一个新创建的模型项。

异常

异常 条件
ArgumentNullException

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

备注

ModelFactory 类在用户创建新项时调用 CreateItem 方法。

.NET Framework 安全性

请参见

参考

ModelService 类

CreateItem 重载

Microsoft.Windows.Design.Services 命名空间

ModelItem

ModelFactory

其他资源

编辑模型体系结构

WPF 设计器扩展性