FrameworkPropertyMetadata FrameworkPropertyMetadata FrameworkPropertyMetadata FrameworkPropertyMetadata Class

定義

為相依性屬性回報或套用中繼資料,特別加入架構專屬的屬性系統特性。Reports or applies metadata for a dependency property, specifically adding framework-specific property system characteristics.

public ref class FrameworkPropertyMetadata : System::Windows::UIPropertyMetadata
public class FrameworkPropertyMetadata : System.Windows.UIPropertyMetadata
type FrameworkPropertyMetadata = class
    inherit UIPropertyMetadata
Public Class FrameworkPropertyMetadata
Inherits UIPropertyMetadata
繼承

範例

下列範例會取得特定擁有者之相依性屬性的中繼資料, 做為PropertyMetadata初始基底類型。The following example gets metadata for a dependency property on a particular owner as the initial base PropertyMetadata type. 該中繼資料會轉換FrameworkPropertyMetadata成。That metadata is cast to FrameworkPropertyMetadata. 如果轉換傳回有效FrameworkPropertyMetadata的, 則會透過簡單的 UI (未顯示) 來報告各種FrameworkPropertyMetadata屬性值。If the cast returned a valid FrameworkPropertyMetadata, then various FrameworkPropertyMetadata property values are reported through a simple UI (not shown).

pm = dp.GetMetadata(dp.OwnerType);
pm = dp.GetMetadata(dp.OwnerType)
FrameworkPropertyMetadata fpm = pm as FrameworkPropertyMetadata;
if (fpm!=null) {
    AffectsArrange.Text = (fpm.AffectsArrange) ? "Yes" : "No";
    AffectsMeasure.Text = (fpm.AffectsMeasure) ? "Yes" : "No";
    AffectsRender.Text = (fpm.AffectsRender) ? "Yes" : "No";
    Inherits.Text = (fpm.Inherits) ? "Yes" : "No";
    IsDataBindingAllowed.Text = (fpm.IsDataBindingAllowed) ? "Yes" : "No";
    BindsTwoWayByDefault.Text = (fpm.BindsTwoWayByDefault) ? "Yes" : "No";
}         
Dim fpm As FrameworkPropertyMetadata = TryCast(pm, FrameworkPropertyMetadata)
If fpm IsNot Nothing Then
	AffectsArrange.Text = If((fpm.AffectsArrange), "Yes", "No")
	AffectsMeasure.Text = If((fpm.AffectsMeasure), "Yes", "No")
	AffectsRender.Text = If((fpm.AffectsRender), "Yes", "No")
              [Inherits].Text = If((fpm.Inherits), "Yes", "No")
	IsDataBindingAllowed.Text = If((fpm.IsDataBindingAllowed), "Yes", "No")
	BindsTwoWayByDefault.Text = If((fpm.BindsTwoWayByDefault), "Yes", "No")

備註

這個類別衍生自PropertyMetadata (至UIPropertyMetadata)。This class derives from PropertyMetadata (through UIPropertyMetadata) . 對於大部分的 WPF 架構層級應用程式開發FrameworkPropertyMetadata目的而言, 是用於相依性屬性中繼資料的類型, 而不PropertyMetadataUIPropertyMetadata基底元資料類型或。For most WPF framework-level application development purposes, FrameworkPropertyMetadata is the type used for dependency property metadata, rather than the base metadata types PropertyMetadata or UIPropertyMetadata. 這適用于現有的相依性屬性和大部分的自訂相依性屬性案例。This is true both for existing dependency properties and for most custom dependency property scenarios.

這個類別所宣告的成員會補充PropertyMetadata基類, 包括指定或報告 WPF 架構層級屬性系統行為 (例如屬性繼承、資料系結和版面配置) 的各種布林值屬性。The members declared by this class that supplement the PropertyMetadata base class include various Boolean properties that specify or report WPF framework-level property system behavior such as property inheritance, data binding, and layout.

用來建立FrameworkPropertyMetadata實例的數個函式簽章會採用參數。FrameworkPropertyMetadataOptionsSeveral constructor signatures for creating a FrameworkPropertyMetadata instance take a FrameworkPropertyMetadataOptions parameter. 列舉僅用於指定在此函式中的初始行為, 而且不會在結構化FrameworkPropertyMetadata之後公開。 FrameworkPropertyMetadataOptionsThe FrameworkPropertyMetadataOptions enumeration is used only to specify initial behavior in the constructor, and is not otherwise exposed after FrameworkPropertyMetadata is constructed. 從已建立的實例, 您可以透過共用函式呼叫中所使用之列舉值名稱的各種屬性, 取得或設定對應的資訊。From a constructed instance, you can get or set the corresponding information through various properties that share the name of the enumeration values used in the constructor call.

XAML 文字使用方式XAML Text Usage

此類別通常不會在中XAMLXAML使用。This class is not typically used in XAMLXAML.

建構函式

FrameworkPropertyMetadata() FrameworkPropertyMetadata() FrameworkPropertyMetadata() FrameworkPropertyMetadata()

初始化 FrameworkPropertyMetadata 類別的新執行個體。Initializes a new instance of the FrameworkPropertyMetadata class.

FrameworkPropertyMetadata(Object) FrameworkPropertyMetadata(Object) FrameworkPropertyMetadata(Object) FrameworkPropertyMetadata(Object)

使用指定的預設值初始化 FrameworkPropertyMetadata 類別的新執行個體。Initializes a new instance of the FrameworkPropertyMetadata class with the specified default value.

FrameworkPropertyMetadata(Object, FrameworkPropertyMetadataOptions) FrameworkPropertyMetadata(Object, FrameworkPropertyMetadataOptions) FrameworkPropertyMetadata(Object, FrameworkPropertyMetadataOptions) FrameworkPropertyMetadata(Object, FrameworkPropertyMetadataOptions)

使用提供的預設值和架構中繼資料選項,初始化 FrameworkPropertyMetadata 類別的新執行個體。Initializes a new instance of the FrameworkPropertyMetadata class with the provided default value and framework-level metadata options.

FrameworkPropertyMetadata(Object, FrameworkPropertyMetadataOptions, PropertyChangedCallback) FrameworkPropertyMetadata(Object, FrameworkPropertyMetadataOptions, PropertyChangedCallback) FrameworkPropertyMetadata(Object, FrameworkPropertyMetadataOptions, PropertyChangedCallback) FrameworkPropertyMetadata(Object, FrameworkPropertyMetadataOptions, PropertyChangedCallback)

使用提供的預設值和架構中繼資料選項,以及指定的 FrameworkPropertyMetadata 回呼,初始化 PropertyChangedCallback 類別的新執行個體。Initializes a new instance of the FrameworkPropertyMetadata class with the provided default value and framework metadata options, and specified PropertyChangedCallback callback.

FrameworkPropertyMetadata(Object, FrameworkPropertyMetadataOptions, PropertyChangedCallback, CoerceValueCallback) FrameworkPropertyMetadata(Object, FrameworkPropertyMetadataOptions, PropertyChangedCallback, CoerceValueCallback) FrameworkPropertyMetadata(Object, FrameworkPropertyMetadataOptions, PropertyChangedCallback, CoerceValueCallback) FrameworkPropertyMetadata(Object, FrameworkPropertyMetadataOptions, PropertyChangedCallback, CoerceValueCallback)

使用提供的預設值和架構中繼資料選項,以及指定的回呼,初始化 FrameworkPropertyMetadata 類別的新執行個體。Initializes a new instance of the FrameworkPropertyMetadata class with the provided default value and framework metadata options, and specified callbacks.

FrameworkPropertyMetadata(Object, FrameworkPropertyMetadataOptions, PropertyChangedCallback, CoerceValueCallback, Boolean) FrameworkPropertyMetadata(Object, FrameworkPropertyMetadataOptions, PropertyChangedCallback, CoerceValueCallback, Boolean) FrameworkPropertyMetadata(Object, FrameworkPropertyMetadataOptions, PropertyChangedCallback, CoerceValueCallback, Boolean) FrameworkPropertyMetadata(Object, FrameworkPropertyMetadataOptions, PropertyChangedCallback, CoerceValueCallback, Boolean)

使用提供的預設值和架構中繼資料選項、指定的回呼,以及可用以防止屬性動畫的布林值,初始化 FrameworkPropertyMetadata 類別的新執行個體。Initializes a new instance of the FrameworkPropertyMetadata class with the provided default value and framework metadata options, specified callbacks, and a Boolean that can be used to prevent animation of the property.

FrameworkPropertyMetadata(Object, FrameworkPropertyMetadataOptions, PropertyChangedCallback, CoerceValueCallback, Boolean, UpdateSourceTrigger) FrameworkPropertyMetadata(Object, FrameworkPropertyMetadataOptions, PropertyChangedCallback, CoerceValueCallback, Boolean, UpdateSourceTrigger) FrameworkPropertyMetadata(Object, FrameworkPropertyMetadataOptions, PropertyChangedCallback, CoerceValueCallback, Boolean, UpdateSourceTrigger) FrameworkPropertyMetadata(Object, FrameworkPropertyMetadataOptions, PropertyChangedCallback, CoerceValueCallback, Boolean, UpdateSourceTrigger)

使用提供的預設值和架構中繼資料選項、指定的回呼、可用以防止屬性動畫的布林值,以及資料繫結更新觸發程序的預設值,初始化 FrameworkPropertyMetadata 類別的新執行個體。Initializes a new instance of the FrameworkPropertyMetadata class with the provided default value and framework metadata options, specified callbacks, a Boolean that can be used to prevent animation of the property, and a data-binding update trigger default.

FrameworkPropertyMetadata(Object, PropertyChangedCallback) FrameworkPropertyMetadata(Object, PropertyChangedCallback) FrameworkPropertyMetadata(Object, PropertyChangedCallback) FrameworkPropertyMetadata(Object, PropertyChangedCallback)

使用提供的預設值和指定的 FrameworkPropertyMetadata 回呼,初始化 PropertyChangedCallback 類別的新執行個體。Initializes a new instance of the FrameworkPropertyMetadata class with the provided default value and specified PropertyChangedCallback callback.

FrameworkPropertyMetadata(Object, PropertyChangedCallback, CoerceValueCallback) FrameworkPropertyMetadata(Object, PropertyChangedCallback, CoerceValueCallback) FrameworkPropertyMetadata(Object, PropertyChangedCallback, CoerceValueCallback) FrameworkPropertyMetadata(Object, PropertyChangedCallback, CoerceValueCallback)

使用提供的預設值和指定的回呼,初始化 FrameworkPropertyMetadata 類別的新執行個體。Initializes a new instance of the FrameworkPropertyMetadata class with the provided default value and specified callbacks.

FrameworkPropertyMetadata(PropertyChangedCallback) FrameworkPropertyMetadata(PropertyChangedCallback) FrameworkPropertyMetadata(PropertyChangedCallback) FrameworkPropertyMetadata(PropertyChangedCallback)

使用指定的 FrameworkPropertyMetadata 回呼初始化 PropertyChangedCallback 類別的新執行個體。Initializes a new instance of the FrameworkPropertyMetadata class with the specified PropertyChangedCallback callback.

FrameworkPropertyMetadata(PropertyChangedCallback, CoerceValueCallback) FrameworkPropertyMetadata(PropertyChangedCallback, CoerceValueCallback) FrameworkPropertyMetadata(PropertyChangedCallback, CoerceValueCallback) FrameworkPropertyMetadata(PropertyChangedCallback, CoerceValueCallback)

使用指定的回呼初始化 FrameworkPropertyMetadata 類別的新執行個體。Initializes a new instance of the FrameworkPropertyMetadata class with the specified callbacks.

屬性

AffectsArrange AffectsArrange AffectsArrange AffectsArrange

取得或設定值,指出相依性屬性在配置引擎作業期間,是否可能會影響排列傳遞。Gets or sets a value that indicates whether a dependency property potentially affects the arrange pass during layout engine operations.

AffectsMeasure AffectsMeasure AffectsMeasure AffectsMeasure

取得或設定值,指出相依性屬性在配置引擎作業期間,是否可能會影響測量行程。Gets or sets a value that indicates whether a dependency property potentially affects the measure pass during layout engine operations.

AffectsParentArrange AffectsParentArrange AffectsParentArrange AffectsParentArrange

取得或設定值,指出相依性屬性在配置引擎作業期間,是否可能會影響其父項目配置的排列傳遞。Gets or sets a value that indicates whether a dependency property potentially affects the arrange pass of its parent element's layout during layout engine operations.

AffectsParentMeasure AffectsParentMeasure AffectsParentMeasure AffectsParentMeasure

取得或設定值,指出相依性屬性在配置引擎作業期間,是否可能會影響其父項目配置的測量行程。Gets or sets a value that indicates whether a dependency property potentially affects the measure pass of its parent element's layout during layout engine operations.

AffectsRender AffectsRender AffectsRender AffectsRender

取得或設定值,指出相依性屬性是否可能影響一般的版面配置,而不會特別影響排列或測量,但可能需要重新繪製。Gets or sets a value that indicates whether a dependency property potentially affects the general layout in some way that does not specifically influence arrangement or measurement, but would require a redraw.

BindsTwoWayByDefault BindsTwoWayByDefault BindsTwoWayByDefault BindsTwoWayByDefault

取得或設定值,指出屬性是否預設雙向繫結。Gets or sets a value that indicates whether the property binds two-way by default.

CoerceValueCallback CoerceValueCallback CoerceValueCallback CoerceValueCallback

取得或設定在這個中繼資料中指定之 CoerceValueCallback 實作的參考。Gets or sets a reference to a CoerceValueCallback implementation specified in this metadata.

(Inherited from PropertyMetadata)
DefaultUpdateSourceTrigger DefaultUpdateSourceTrigger DefaultUpdateSourceTrigger DefaultUpdateSourceTrigger

取得或設定當套用具有這個中繼資料 (且 UpdateSourceTrigger 設為 UpdateSourceTrigger) 之屬性的繫結時,所要使用的預設 DefaultGets or sets the default for UpdateSourceTrigger to use when bindings for the property with this metadata are applied, which have their UpdateSourceTrigger set to Default.

DefaultValue DefaultValue DefaultValue DefaultValue

取得或設定相依性屬性的預設值。Gets or sets the default value of the dependency property.

(Inherited from PropertyMetadata)
Inherits Inherits Inherits Inherits

取得或設定值,指出相依性屬性的值是否為可繼承。Gets or sets a value that indicates whether the value of the dependency property is inheritable.

IsAnimationProhibited IsAnimationProhibited IsAnimationProhibited IsAnimationProhibited

取得或設定值,這個值宣告是否應停用套用包含中繼資料執行個體之相依性屬性上的動畫。Gets or sets a value declaring whether animations should be disabled on the dependency property where the containing metadata instance is applied.

(Inherited from UIPropertyMetadata)
IsDataBindingAllowed IsDataBindingAllowed IsDataBindingAllowed IsDataBindingAllowed

取得值,指出相依性屬性是否支援資料繫結。Gets a value that indicates whether data binding is supported for the dependency property.

IsNotDataBindable IsNotDataBindable IsNotDataBindable IsNotDataBindable

取得或設定值,指出相依性屬性是否支援資料繫結。Gets or sets a value that indicates whether the dependency property supports data binding.

IsSealed IsSealed IsSealed 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.

(Inherited from PropertyMetadata)
Journal Journal Journal Journal

取得或設定值,指出此屬性是否包含日誌記錄資訊,其為應用程式可以或應該儲存為日誌記錄實作的一部分。Gets or sets a value that indicates whether this property contains journaling information that applications can or should store as part of a journaling implementation.

OverridesInheritanceBehavior OverridesInheritanceBehavior OverridesInheritanceBehavior OverridesInheritanceBehavior

取得或設定值,這個值表示屬性值繼承評估是否應該跨越項目邏輯樹狀中的特定內容界限。Gets or sets a value that indicates whether the property value inheritance evaluation should span across certain content boundaries in the logical tree of elements.

PropertyChangedCallback PropertyChangedCallback PropertyChangedCallback PropertyChangedCallback

取得或設定在這個中繼資料中指定之 PropertyChangedCallback 實作的參考。Gets or sets a reference to a PropertyChangedCallback implementation specified in this metadata.

(Inherited from PropertyMetadata)
SubPropertiesDoNotAffectRender SubPropertiesDoNotAffectRender SubPropertiesDoNotAffectRender SubPropertiesDoNotAffectRender

取得或設定值,指出相依性屬性的子屬性是否不會影響包含物件的呈現。Gets or sets a value that indicates whether sub-properties of the dependency property do not affect the rendering of the containing object.

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

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

(Inherited from Object)
GetType() GetType() GetType() GetType()

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

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
Merge(PropertyMetadata, DependencyProperty) Merge(PropertyMetadata, DependencyProperty) Merge(PropertyMetadata, DependencyProperty) Merge(PropertyMetadata, DependencyProperty)

啟用來源中繼資料與基底中繼資料的合併。Enables a merge of the source metadata with base metadata.

OnApply(DependencyProperty, Type) OnApply(DependencyProperty, Type) OnApply(DependencyProperty, Type) OnApply(DependencyProperty, Type)

在這個中繼資料已套用至屬性時呼叫,表示要密封中繼資料。Called when this metadata has been applied to a property, which indicates that the metadata is being sealed.

ToString() ToString() ToString() ToString()

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

(Inherited from Object)

適用於

另請參閱