PropertyMetadata Class

Definition

Defines certain behavior aspects of a dependency property as it is applied to a specific type, including conditions it was registered with.Defines certain behavior aspects of a dependency property as it is applied to a specific type, including conditions it was registered with.

public ref class PropertyMetadata
public class PropertyMetadata
type PropertyMetadata = class
Public Class PropertyMetadata
Inheritance
PropertyMetadata
Derived

Remarks

呼叫 Register 方法(或附加屬性或唯讀相依性屬性的變化)時,或在呼叫 OverrideMetadata 方法時,在原始擁有者註冊之後,可以定義和使用相依性屬性註冊期間的屬性中繼資料。Property metadata can be defined and used during dependency property registration when calling the Register method (or variations for attached properties or read-only dependency properties), or after original owner registration when calling the OverrideMetadata method. AddOwner 也會採用屬性中繼資料。AddOwner also takes property metadata.

這個類別是可用於每個呼叫中的實體基類。This class is a concrete base class that can be used in each of these calls. 不過,使用其中一個衍生類別(例如 FrameworkPropertyMetadata)來指定中繼資料是很常見的。However, it is very common to specify metadata using one of the derived classes such as FrameworkPropertyMetadata. 這些衍生類別支援將更詳細的中繼資料當做布林屬性值來執行,這對於偵測或啟用只在 WPFWPF framework 層級執行的某些屬性系統和版面配置行為很有用。These derived classes support more detailed metadata carried as Boolean property values, which are useful for either detecting or enabling some property system and layout behaviors that are only implemented at the WPFWPF framework level.

這個類別的幾個屬性是對物件模型的讀寫,但只能在實例用於屬性系統作業(例如 RegisterOverrideMetadata)之前寫入。Several properties of this class are read-write to the object model, but can only be written prior to the instance being used in a property system operation such as Register or OverrideMetadata. 這些屬性的每一個也都可以由函式設定,但會公開,讓 Merge 方法的執行可以設定它們。Each of these properties could also have been set by the constructor but are exposed so that Merge method implementations can set them.

XAML 文字使用方式XAML Text Usage

這個類型和此類型的成員,通常不會用在 XAMLXAML中。This type, and members of this type, are not typically used in XAMLXAML.

Constructors

PropertyMetadata()

Initializes a new instance of the PropertyMetadata class.Initializes a new instance of the PropertyMetadata class.

PropertyMetadata(Object)

Initializes a new instance of the PropertyMetadata class with a specified default value for the dependency property that this metadata will be applied to.Initializes a new instance of the PropertyMetadata class with a specified default value for the dependency property that this metadata will be applied to.

PropertyMetadata(Object, PropertyChangedCallback)

Initializes a new instance of the PropertyMetadata class with the specified default value and PropertyChangedCallback implementation reference.Initializes a new instance of the PropertyMetadata class with the specified default value and PropertyChangedCallback implementation reference.

PropertyMetadata(Object, PropertyChangedCallback, CoerceValueCallback)

Initializes a new instance of the PropertyMetadata class with the specified default value and callbacks.Initializes a new instance of the PropertyMetadata class with the specified default value and callbacks.

PropertyMetadata(PropertyChangedCallback)

Initializes a new instance of the PropertyMetadata class with the specified PropertyChangedCallback implementation reference.Initializes a new instance of the PropertyMetadata class with the specified PropertyChangedCallback implementation reference.

Properties

CoerceValueCallback

Gets or sets a reference to a CoerceValueCallback implementation specified in this metadata.Gets or sets a reference to a CoerceValueCallback implementation specified in this metadata.

DefaultValue

Gets or sets the default value of the dependency property.Gets or sets the default value of the dependency property.

IsSealed

Gets a value that determines whether the metadata has been applied to a property in some way, resulting in the immutable state of that metadata instance.Gets a value that determines whether the metadata has been applied to a property in some way, resulting in the immutable state of that metadata instance.

PropertyChangedCallback

Gets or sets a reference to a PropertyChangedCallback implementation specified in this metadata.Gets or sets a reference to a PropertyChangedCallback implementation specified in this metadata.

Methods

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(Inherited from Object)
Merge(PropertyMetadata, DependencyProperty)

Merges this metadata with the base metadata.Merges this metadata with the base metadata.

OnApply(DependencyProperty, Type)

Called when this metadata has been applied to a property, which indicates that the metadata is being sealed.Called when this metadata has been applied to a property, which indicates that the metadata is being sealed.

ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)

Applies to