ModelService Class
Provides the main entry point that the designer uses to obtain the editing model.
Assembly: Microsoft.Windows.Design.Interaction (in Microsoft.Windows.Design.Interaction.dll)
The ModelService type exposes the following members.
| Name | Description | |
|---|---|---|
|
ConvertItem | Converts a ModelItem created in another designer to a ModelItem for this designer. |
|
CreateItem(Object) | When overridden in a derived class, creates a model item that is a deep copy of the specified instance. |
|
CreateItem(Type, CreateOptions, Object[]) | When overridden in a derived class, creates a ModelItem object for a specified type. |
|
CreateStaticMemberItem | When overridden in a derived class, creates a new model item that represents the value of a static member of the specified class. |
|
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
|
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
|
Find(ModelItem, TypeIdentifier) | When overridden in a derived class, finds matching model items for a specified starting point. |
|
Find(ModelItem, Predicate<Type>) | When overridden in a derived class, finds matching model items for a specified starting point. |
|
Find(ModelItem, Type) | When overridden in a derived class, finds matching model items for a specified starting point. |
|
FromName(ModelItem, String) | Finds the model item in the specified scope with the specified name. |
|
FromName(ModelItem, String, StringComparison) | When overridden in a derived class, finds the model item in the specified scope with the specified name and comparison criteria. |
|
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
|
GetType | Gets the Type of the current instance. (Inherited from Object.) |
|
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
|
ResolveType | Resolves the specified TypeIdentifier to a Type. |
|
ToString | Returns a string that represents the current object. (Inherited from Object.) |
| Name | Description | |
|---|---|---|
|
ModelChanged | When overridden in a derived class, occurs when an item in the model has changed. |
The ModelService class provides an entry point for the editing model and for global event notifications. ModelService is provided by the serialization engine and is used to gain access to the model.
In addition to the ModelService, the designer must map visuals to underlying model items. A 1:1 mapping between a visual and a model item is not required, but there must be an association between visuals and model items. The ViewService class fulfills this role.
The ModelService and ViewService classes are required for the designer to function. The DesignerView class, which is responsible for processing user input and routing it to commands, requires both of these services to map user input back to the model.
The public methods of ModelService can be called by any code. The protected methods are invoked by the editing model.