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
Protected method ModelProperty Initializes a new instance of the ModelProperty class.

Top

Properties

  Name Description
Public property AttachedOwnerType When overridden in a derived class, gets the type which defines this property.
Public property Collection When overridden in a derived class, gets the Value property cast as a ModelItemCollection.
Public property ComputedValue When overridden in a derived class, gets the currently computed value for this property.
Public property DefaultValue When overridden in a derived class, gets the default value for this property.
Public property Dictionary When overridden in a derived class, gets the Value property cast as a ModelItemDictionary.
Public property IsAttached When overridden in a derived class, gets a value indicating whether the property represents an attached property from a different type.
Public property IsBrowsable When overridden in a derived class, gets a value indicating whether the property can be shown in a property window.
Public property IsCollection When overridden in a derived class, gets a value indicating whether the value contained in the property is an ItemCollection.
Public property IsDictionary When overridden in a derived class, gets a value indicating whether the value contained in the property is an ItemDictionary.
Public property IsReadOnly When overridden in a derived class, gets a value indicating whether the property is read-only.
Public property IsSet When overridden in a derived class, gets a value indicating whether the property's value is set locally.
Public property Name When overridden in a derived class, gets the name of this property.
Public property Parent When overridden in a derived class, gets the parent of this property.
Public property PropertyType When overridden in a derived class, gets the data type of the property.
Public property Value When overridden in a derived class, gets the value of this property.

Top

Methods

  Name Description
Public method ClearValue When overridden in a derived class, clears the local value for the property.
Public method Equals Determines whether the specified object is equal to this ModelProperty object. (Overrides Object.Equals(Object).)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetAttributes(Type) Gets the attributes of the requested type that are declared on this property and the property's property type.
Public method GetAttributes(TypeIdentifier) Gets the attributes of the requested type that are declared on this property and the property's property type.
Public method GetHashCode Serves as a hash function for a particular type. (Overrides Object.GetHashCode().)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method IsPropertyOfType(Type) Gets a value that indicates whether this property is of the specified type or implements the specified interface.
Public method IsPropertyOfType(TypeIdentifier) Gets a value that indicates whether this property is of the specified type or implements the specified interface.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method SetValue When overridden in a derived class, sets a local value on a property.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Operators

  Name Description
Public operatorStatic member Equality Determines whether two specified ModelProperty objects are equal.
Public operatorStatic member 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

Other Resources

WPF Designer Extensibility Architecture