ModelProperty 类
定义
ModelProperty 表示 ModelItem 上的属性。A ModelProperty represents a property on a ModelItem. 模型属性与项的实例关联,从而允许它们具有简单的 Value get/set 属性,而不是使用 PropertyDescriptor 比较麻烦的 GetValue/SetValue 机制。Model properties are associated with an instance of an item, which allows them to have simple Value get/set properties instead of using the more cumbersome GetValue/SetValue mechanism of PropertyDescriptor.
public ref class ModelProperty abstract
public abstract class ModelProperty
type ModelProperty = class
Public MustInherit Class ModelProperty
- 继承
-
ModelProperty
注解
ModelProperty 的值可能来自本地设置的值,或可能继承自元素层次结构中的某个较高位置。The value of a ModelProperty may come from a locally set value, or it may be inherited from somewhere higher up in the element hierarchy. 使用 Source 所返回值的 Value 属性来确定属性值的源。Use the Source property of the value returned by Value to determine the source of the property value.
构造函数
| ModelProperty() |
创建一个新的 ModelProperty。Creates a new ModelProperty. |
属性
| AttachedOwnerType |
如果 IsAttached 返回 |
| Attributes |
返回在此属性上声明的特性。Returns the attributes declared on this property. |
| Collection |
以 Value 的形式返回 ModelItemCollection 强制转换。Returns Value cast as a ModelItemCollection. |
| ComputedValue |
返回此属性的当前计算所得值。Returns the currently computed value for this property. 在此属性上设置值与调用 SetValue(Object) 相同,但可在数据绑定表达式中使用。Setting a value on this property is the same as calling SetValue(Object), but can be used in data binding expressions. |
| Converter |
返回要用于此属性的类型转换器。Returns the type converter to use with this property. |
| DefaultValue |
返回此属性的默认值。Returns the default value for this property. 如果属性未定义默认值,则此属性将返回 |
| Dictionary |
以 Value 的形式返回 ModelItemDictionary 强制转换。Returns Value cast as a ModelItemDictionary. 如果属性值不是字典,则此属性将返回 |
| IsAttached |
确定属性是否表示不同类型中的附加属性。Determines whether the property represents an attached property from a different type. |
| IsBrowsable |
确定属性是否可显示在属性窗口中。Determines whether the property can be shown in a property window. |
| IsCollection |
确定属性中包含的值是否为 ModelItemCollection。Determines whether the value contained in the property is a ModelItemCollection. |
| IsDictionary |
确定属性中包含的值是否为 ModelItemDictionary。Determines whether the value contained in the property is a ModelItemDictionary. |
| IsReadOnly |
确定属性是否为只读。Determines whether the property is read only. |
| IsSet |
确定属性的值是否是在本地设置的。Determines whether the value of the property is set locally. |
| Name |
获取此属性的名称。Gets the name of this property. |
| Parent |
返回此属性的父级。Returns the parent of this property. |
| PropertyType |
返回属性的数据类型。Returns the data type of the property. |
| Value |
返回设置到此属性中的值。Returns the value set into this property. |
方法
| ClearValue() |
清除属性的本地值。Clears the local value for the property. |
| Equals(Object) |
确定属性的相等性。Determines the equality for properties. 如果属性具有相同的名称和父级,则属性相等。Properties are equal if they have the same name and parent. |
| GetHashCode() |
作为 ModelProperty 的哈希函数。Serves as a hash function for a ModelProperty. |
| GetType() |
获取当前实例的 Type。Gets the Type of the current instance. (继承自 Object) |
| MemberwiseClone() |
创建当前 Object 的浅表副本。Creates a shallow copy of the current Object. (继承自 Object) |
| SetValue(Object) |
在属性上设置本地值。Sets a local value on a property. |
| ToString() |
返回表示当前对象的字符串。Returns a string that represents the current object. (继承自 Object) |
运算符
| Equality(ModelProperty, ModelProperty) |
确定属性是否相等。Determines whether the properties are equal. 如果属性具有相同的名称和父级,则属性相等。Properties are equal if they have the same name and parent. |
| Inequality(ModelProperty, ModelProperty) |
确定属性是否不相等。Determines whether the properties are unequal. 如果属性具有相同的名称和父级,则属性相等。Properties are equal if they have the same name and parent. |