ModelFactory Class

Used to create instances of model items in the designer.

System.Object
  Microsoft.Windows.Design.Model.ModelFactory

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

public static class ModelFactory

The ModelFactory type exposes the following members.

  NameDescription
Public methodStatic memberCreateItem(EditingContext, Object)Creates a new model item by creating a deep copy of the specified object.
Public methodStatic memberCreateItem(EditingContext, TypeIdentifier, Object[])Creates a new model item for the specified type identifier.
Public methodStatic memberCreateItem(EditingContext, Type, Object[])Creates a new model item for the specified item type.
Public methodStatic memberCreateItem(EditingContext, TypeIdentifier, CreateOptions, Object[])Creates a new model item for the specified type identifier.
Public methodStatic memberCreateItem(EditingContext, Type, CreateOptions, Object[])Creates a new model item for the specified item type.
Public methodStatic memberCreateStaticMemberItem(EditingContext, TypeIdentifier, String)Creates a new model item that represents the value of a static member of the specified class.
Public methodStatic memberCreateStaticMemberItem(EditingContext, Type, String)Creates a new model item that represents the value of a static member of the specified class.
Public methodStatic memberResolveTypeGets a resolved type for the specified TypeIdentifier.
Top

ModelFactory is designed to be a static API for convenience. The underlying implementation of this API simply calls the CreateItem method of ModelService.

Always use the CreateItem method to create new objects on the design surface. This is because many raw instances cannot be parsed into model items. Once a value is set in the model, you should only interact with it through the model. The instance backing the model can be rebuilt by the framework at any time, which invalidates any references you have cached.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show: