ModelItem Class
Represents a single item in the editing model.
Microsoft.Windows.Design.Model.ModelItem
Microsoft.Windows.Design.Model.ModelItemCollection
Microsoft.Windows.Design.Model.ModelItemDictionary
Assembly: Microsoft.Windows.Design.Interaction (in Microsoft.Windows.Design.Interaction.dll)
The ModelItem type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | 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. |
| Name | Description | |
|---|---|---|
![]() | 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.) |
| Name | Description | |
|---|---|---|
![]() | 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.
Note |
|---|
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. |
Note |
|---|
Use the invariant culture when setting model item values by using strings. |
