Freigeben über


ModelFactory.CreateItem-Methode (EditingContext, Type, CreateOptions, array<Object )

Erstellt ein neues Modellelement für den angegebenen Elementtyp.

Namespace:  Microsoft.Windows.Design.Model
Assembly:  Microsoft.Windows.Design.Interaction (in Microsoft.Windows.Design.Interaction.dll)

Syntax

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

Parameter

  • itemType
    Typ: System.Type
    Ein Type, der den Typ des zu erstellenden Elements darstellt.
  • arguments
    Typ: array<System.Object[]
    Ein optionales Array von Argumenten, die an den Konstruktor des Elements übergeben werden sollen.

Rückgabewert

Typ: Microsoft.Windows.Design.Model.ModelItem
Ein ModelItem, das den neu erstellten Elementtyp darstellt.

Ausnahmen

Ausnahme Bedingung
ArgumentNullException

itemType oder context ist nullNULL-Verweis (Nothing in Visual Basic).

ArgumentOutOfRangeException

options ist ungültig.

InvalidOperationException

Es gibt kein Bearbeitungsmodell im Kontext, das neue Elemente erstellen kann.

.NET Framework-Sicherheit

Siehe auch

Referenz

ModelFactory Klasse

CreateItem-Überladung

Microsoft.Windows.Design.Model-Namespace

Weitere Ressourcen

WPF-Designer-Erweiterbarkeit

Bearbeitungsmodellarchitektur