Export (0) Print
Expand All

ModelFactory.CreateItem Method (EditingContext, Type, Object[])

Creates a new model item for the specified item type.

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

public static ModelItem CreateItem(
	EditingContext context,
	Type itemType,
	params Object[] arguments
)

Parameters

context
Type: Microsoft.Windows.Design.EditingContext
An EditingContext representing the designer's editing context.
itemType
Type: System.Type
A Type representing the type of item to create.
arguments
Type: System.Object[]
An optional array of arguments that should be passed to the constructor of the item.

Return Value

Type: Microsoft.Windows.Design.Model.ModelItem
A ModelItem that represents the newly created item type.

ExceptionCondition
ArgumentNullException

itemType or context is null.

InvalidOperationException

There is no editing model in the context that can create new items.

Community Additions

ADD
Show:
© 2015 Microsoft