Export (0) Print
Expand All

ModelItem Class

Represents a single item in the editing model.

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

public abstract class ModelItem : INotifyPropertyChanged

The ModelItem type exposes the following members.

  NameDescription
Protected methodModelItemInitializes a new instance of the ModelItem class.
Top

  NameDescription
Public propertyContentWhen overridden in a derived class, gets a ModelProperty representing the item's ContentPropertyAttribute.
Public propertyContextGets an object that contains contextual information about the designer this ModelItem was created for.
Public propertyEventsWhen overridden in a derived class, gets the public events on this object.
Public propertyItemTypeWhen overridden in a derived class, gets the type of object the item represents.
Public propertyNameWhen overridden in a derived class, gets or sets the name or ID of the item.
Public propertyParentWhen overridden in a derived class, gets the item that is the parent of this item.
Public propertyPropertiesWhen overridden in a derived class, gets the public properties on this object.
Public propertyRootWhen overridden in a derived class, gets the item that is the root of this tree.
Public propertySourceWhen overridden in a derived class, gets the property that provided this value.
Public propertyViewWhen overridden in a derived class, gets the visual or visual3D representing the UI for this item.
Top

  NameDescription
Public methodBeginEdit()When overridden in a derived class, this method is called when performing multiple operations on an object or group of objects.
Public methodBeginEdit(String)When overridden in a derived class, this method is called when performing multiple operations on an object or group of objects.
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 methodGetAttributes(Type)Gets the attributes of the requested type that are declared on this item.
Public methodGetAttributes(TypeIdentifier)Gets the attributes of the requested type that are declared on this item.
Public methodGetCurrentValueWhen overridden in a derived class, returns the current value of the underlying model object the ModelItem is wrapping.
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodIsItemOfType(Type)Gets a value that indicates whether this item is of the specified type or implements the specified interface.
Public methodIsItemOfType(TypeIdentifier)Gets a value that indicates whether this item is of the specified type or implements the specified interface.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Public eventPropertyChangedWhen overridden in a derived class, occurs when a property on the model changes.
Top

The ModelItem class represents a single item in the editing model. An item can be anything from a window or a control down to a color or an integer. You may access the item’s properties through its Properties collection and make changes to the values of the properties. A ModelItem is essentially a wrapper around the designer’s underlying data model. You can access the underlying model through the GetCurrentValue method.

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.

NoteNote

You should never make any serializable changes to an object returned from the GetCurrentValue method. The changes will not be reflected back in the designer’s serialization or undo systems.

NoteNote

Use the invariant culture when setting model item values by using strings.

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:
© 2014 Microsoft