ModelFactory Class
Visual Studio 2010
Used to create instances of model items in the designer.
Namespace:
Microsoft.Windows.Design.Model
Assembly: Microsoft.Windows.Design.Interaction (in Microsoft.Windows.Design.Interaction.dll)
The ModelFactory type exposes the following members.
| Name | Description | |
|---|---|---|
![]() ![]() | CreateItem(EditingContext, Object) | Creates a new model item by creating a deep copy of the specified object. |
![]() ![]() | CreateItem(EditingContext, TypeIdentifier, Object[]) | Creates a new model item for the specified type identifier. |
![]() ![]() | CreateItem(EditingContext, Type, Object[]) | Creates a new model item for the specified item type. |
![]() ![]() | CreateItem(EditingContext, TypeIdentifier, CreateOptions, Object[]) | Creates a new model item for the specified type identifier. |
![]() ![]() | CreateItem(EditingContext, Type, CreateOptions, Object[]) | Creates a new model item for the specified item type. |
![]() ![]() | CreateStaticMemberItem(EditingContext, TypeIdentifier, String) | Creates a new model item that represents the value of a static member of the specified class. |
![]() ![]() | CreateStaticMemberItem(EditingContext, Type, String) | Creates a new model item that represents the value of a static member of the specified class. |
![]() ![]() | ResolveType | Gets a resolved type for the specified TypeIdentifier. |
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.
