ModelProperty Class
Represents a property on an item.
Inheritance Hierarchy
System.Object
Microsoft.Windows.Design.Model.ModelProperty
Namespace: Microsoft.Windows.Design.Model
Assembly: Microsoft.Windows.Design.Interaction (in Microsoft.Windows.Design.Interaction.dll)
Syntax
'Declaration
Public MustInherit Class ModelProperty
public abstract class ModelProperty
public ref class ModelProperty abstract
[<AbstractClass>]
type ModelProperty = class end
public abstract class ModelProperty
The ModelProperty type exposes the following members.
Constructors
Name | Description | |
---|---|---|
ModelProperty | Initializes a new instance of the ModelProperty class. |
Top
Properties
Name | Description | |
---|---|---|
AttachedOwnerType | When overridden in a derived class, gets the type which defines this property. | |
Collection | When overridden in a derived class, gets the Value property cast as a ModelItemCollection. | |
ComputedValue | When overridden in a derived class, gets the currently computed value for this property. | |
DefaultValue | When overridden in a derived class, gets the default value for this property. | |
Dictionary | When overridden in a derived class, gets the Value property cast as a ModelItemDictionary. | |
IsAttached | When overridden in a derived class, gets a value indicating whether the property represents an attached property from a different type. | |
IsBrowsable | When overridden in a derived class, gets a value indicating whether the property can be shown in a property window. | |
IsCollection | When overridden in a derived class, gets a value indicating whether the value contained in the property is an ItemCollection. | |
IsDictionary | When overridden in a derived class, gets a value indicating whether the value contained in the property is an ItemDictionary. | |
IsReadOnly | When overridden in a derived class, gets a value indicating whether the property is read-only. | |
IsSet | When overridden in a derived class, gets a value indicating whether the property's value is set locally. | |
Name | When overridden in a derived class, gets the name of this property. | |
Parent | When overridden in a derived class, gets the parent of this property. | |
PropertyType | When overridden in a derived class, gets the data type of the property. | |
Value | When overridden in a derived class, gets the value of this property. |
Top
Methods
Name | Description | |
---|---|---|
ClearValue | When overridden in a derived class, clears the local value for the property. | |
Equals | Determines whether the specified object is equal to this ModelProperty object. (Overrides Object.Equals(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 property and the property's property type. | |
GetAttributes(TypeIdentifier) | Gets the attributes of the requested type that are declared on this property and the property's property type. | |
GetHashCode | Serves as a hash function for a particular type. (Overrides Object.GetHashCode().) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
IsPropertyOfType(Type) | Gets a value that indicates whether this property is of the specified type or implements the specified interface. | |
IsPropertyOfType(TypeIdentifier) | Gets a value that indicates whether this property is of the specified type or implements the specified interface. | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
SetValue | When overridden in a derived class, sets a local value on a property. | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Top
Operators
Name | Description | |
---|---|---|
Equality | Determines whether two specified ModelProperty objects are equal. | |
Inequality | Determines whether two specified ModelProperty objects are not equal. |
Top
Remarks
A ModelProperty represents a property on an item. ModelProperty objects are associated with an instance of an item, which enables them to have simple Value get/set properties, instead of the more cumbersome GetValue/SetValue mechanism of PropertyDescriptor. A ModelProperty’s value may come from a locally set value, or it may be inherited from somewhere higher up in the property mechanism. Because all items in the tree contain Source properties, you can easily determine the real source of a property value by using the following code:
Console.WriteLine(property.Value.Source);
Value returns nulla null reference (Nothing in Visual Basic) if the property is not set anywhere in the hierarchy. Type converters and editors defined on the underlying data model are wrapped so that they accept ModelItem objects as parameters.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also
Reference
Microsoft.Windows.Design.Model Namespace