ModelService Class

Provides the main entry point that the designer uses to obtain the editing model.

System.Object
  Microsoft.Windows.Design.Services.ModelService

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

public abstract class ModelService

The ModelService type exposes the following members.

  NameDescription
Protected methodModelServiceInitializes a new instance of the ModelService class.
Top

  NameDescription
Public propertyRootWhen overridden in a derived class, gets the root of the object hierarchy.
Top

  NameDescription
Public methodConvertItemConverts a ModelItem created in another designer to a ModelItem for this designer.
Protected methodCreateItem(Object)When overridden in a derived class, creates a model item that is a deep copy of the specified instance.
Protected methodCreateItem(Type, CreateOptions, Object[])When overridden in a derived class, creates a ModelItem object for a specified type.
Protected methodCreateStaticMemberItemWhen overridden in a derived class, creates a new model item that represents the value of a static member of the specified class.
Public methodEqualsDetermines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodFind(ModelItem, TypeIdentifier)When overridden in a derived class, finds matching model items for a specified starting point.
Public methodFind(ModelItem, Predicate<Type>)When overridden in a derived class, finds matching model items for a specified starting point.
Public methodFind(ModelItem, Type)When overridden in a derived class, finds matching model items for a specified starting point.
Public methodFromName(ModelItem, String)Finds the model item in the specified scope with the specified name.
Public methodFromName(ModelItem, String, StringComparison)When overridden in a derived class, finds the model item in the specified scope with the specified name and comparison criteria.
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Protected methodResolveTypeResolves the specified TypeIdentifier to a Type.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Public eventModelChangedWhen overridden in a derived class, occurs when an item in the model has changed.
Top

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.

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: