Represents a single item in the editing model.
Assembly: Microsoft.Windows.Design.Interaction (in Microsoft.Windows.Design.Interaction.dll)
'Declaration Public MustInherit Class ModelItem _ Implements INotifyPropertyChanged
public abstract class ModelItem : INotifyPropertyChanged
public ref class ModelItem abstract : INotifyPropertyChanged
[<AbstractClass>] type ModelItem = class interface INotifyPropertyChanged end
public abstract class ModelItem implements INotifyPropertyChanged
The ModelItem type exposes the following members.
|ModelItem||Initializes a new instance of the ModelItem class.|
|Content||When overridden in a derived class, gets a ModelProperty representing the item's ContentPropertyAttribute.|
|Context||Gets an object that contains contextual information about the designer this ModelItem was created for.|
|Events||When overridden in a derived class, gets the public events on this object.|
|ItemType||When overridden in a derived class, gets the type of object the item represents.|
|Name||When overridden in a derived class, gets or sets the name or ID of the item.|
|Parent||When overridden in a derived class, gets the item that is the parent of this item.|
|Properties||When overridden in a derived class, gets the public properties on this object.|
|Root||When overridden in a derived class, gets the item that is the root of this tree.|
|Source||When overridden in a derived class, gets the property that provided this value.|
|View||When overridden in a derived class, gets the visual or visual3D representing the UI for this item.|
|BeginEdit()||When overridden in a derived class, this method is called when performing multiple operations on an object or group of objects.|
|BeginEdit(String)||When overridden in a derived class, this method is called when performing multiple operations on an object or group of objects.|
|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.)|
|GetAttributes(Type)||Gets the attributes of the requested type that are declared on this item.|
|GetAttributes(TypeIdentifier)||Gets the attributes of the requested type that are declared on this item.|
|GetCurrentValue||When overridden in a derived class, returns the current value of the underlying model object the ModelItem is wrapping.|
|GetHashCode||Serves as a hash function for a particular type. (Inherited from Object.)|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|IsItemOfType(Type)||Gets a value that indicates whether this item is of the specified type or implements the specified interface.|
|IsItemOfType(TypeIdentifier)||Gets a value that indicates whether this item is of the specified type or implements the specified interface.|
|MemberwiseClone||Creates a shallow copy of the current Object. (Inherited from Object.)|
|ToString||Returns a string that represents the current object. (Inherited from Object.)|
|PropertyChanged||When overridden in a derived class, occurs when a property on the model changes.|
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.
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.
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.
WPF Designer Extensibility Architecture