DependencyPropertyHelper DependencyPropertyHelper DependencyPropertyHelper DependencyPropertyHelper Class

定義

提供單一 Helper 方法 (GetValueSource(DependencyObject, DependencyProperty)),這個方法會報告相依性屬性之有效值的屬性系統來源。Provides a single helper method (GetValueSource(DependencyObject, DependencyProperty)) that reports the property system source for the effective value of a dependency property.

public ref class DependencyPropertyHelper abstract sealed
public static class DependencyPropertyHelper
type DependencyPropertyHelper = class
Public Class DependencyPropertyHelper
繼承
DependencyPropertyHelperDependencyPropertyHelperDependencyPropertyHelperDependencyPropertyHelper

備註

WPFWPF屬性系統相當複雜, 而且會根據已建立的值判斷優先順序, 依賴合理化可能來自各種輸入的值。TheWPFWPF property system is fairly complex, and relies on rationalizing the values that potentially come from a variety of inputs, based on an established value determination precedence. 因為這些來源可能來自于執行時間程式碼、已編譯的標記, 或甚至是從執行時間的使用者設定, 所以確切知道相依性屬性值系統中的哪一個參與者已建立您在呼叫GetValue時取得的值,會很有説明。該屬性的執行時間。Because these sources potentially come from run-time code, from compiled markup, or even from run-time user settings, it can be useful to know exactly which participant in the dependency property value system established the value you obtain when calling GetValue at run-time on that property. 如果值來自于您所預期的不同來源, 您可能需要調整應用程式的某些層面。If the value came from a different source than you had intended, you might need to adjust some aspect of your application. 值來源可能是樣式、主題、區域值、動畫、系結, 或是以執行時間為基礎的值, 例如透過主題或系統資源的系統設定。The value source might be a style, a theme, a local value, an animation, a binding, or a run-time based value such as system settings through themes or system resources. 如需詳細資訊,請參閱相依性屬性值優先順序For more information, see Dependency Property Value Precedence.

一般會報告屬性的另一個機制, 而不是物件上的特定屬性實例, 就是屬性中繼資料。Another mechanism that reports on the property in general, rather than a specific instance of the property on an object, is the property metadata. 屬性中繼資料的 findable 方式是GetMetadata呼叫並檢查傳回PropertyMetadata的 (或數個傳回的屬性中繼資料所可轉換的可能衍生類別之一)。The property metadata is findable by calling GetMetadata and examining the returned PropertyMetadata (or one of several possible derived classes that the returned property metadata is castable to).

方法

GetValueSource(DependencyObject, DependencyProperty) GetValueSource(DependencyObject, DependencyProperty) GetValueSource(DependencyObject, DependencyProperty) GetValueSource(DependencyObject, DependencyProperty)

傳回結構,該結構報告在特定 DependencyObject 上指定相依性屬性的各種中繼資料和屬性系統特性。Returns a structure that reports various metadata and property system characteristics of a specified dependency property on a particular DependencyObject.

IsTemplatedValueDynamic(DependencyObject, DependencyProperty) IsTemplatedValueDynamic(DependencyObject, DependencyProperty) IsTemplatedValueDynamic(DependencyObject, DependencyProperty) IsTemplatedValueDynamic(DependencyObject, DependencyProperty)

指出指定的項目是否屬於定義指定屬性值的範本執行個體,而此屬性可能會根據其他位置的變更而在執行階段變更。Indicates whether a specified element belongs to an instance of a template that defines a value for the specified property that may change at runtime based on changes elsewhere.

適用於