FrameworkPropertyMetadataOptions 列舉

定義

在 Windows Presentation Foundation (WPF) 屬性系統中,指定屬於特定相依性屬性之架構層級屬性行為的類型。Specifies the types of framework-level property behavior that pertain to a particular dependency property in the Windows Presentation Foundation (WPF) property system.

此列舉具有 FlagsAttribute 個屬性允許以位元方式合併其成員值。

public enum class FrameworkPropertyMetadataOptions
[System.Flags]
public enum FrameworkPropertyMetadataOptions
type FrameworkPropertyMetadataOptions = 
Public Enum FrameworkPropertyMetadataOptions
繼承
FrameworkPropertyMetadataOptions
屬性

欄位

AffectsArrange 2

這個相依性屬性的值變更會影響配置撰寫的排列傳遞。The arrange pass of layout composition is affected by value changes to this dependency property.

AffectsMeasure 1

這個相依性屬性的值變更會影響配置撰寫的測量傳遞。The measure pass of layout compositions is affected by value changes to this dependency property.

AffectsParentArrange 8

這個相依性屬性的值變更會影響父項目的排列傳遞。The arrange pass on the parent element is affected by value changes to this dependency property.

AffectsParentMeasure 4

這個相依性屬性的值變更會影響父項目的測量傳遞。The measure pass on the parent element is affected by value changes to this dependency property.

AffectsRender 16

這個相依性屬性的值變更會影響轉譯或配置撰寫的某些方面 (測量或排列以外的其他方面)。Some aspect of rendering or layout composition (other than measure or arrange) is affected by value changes to this dependency property.

BindsTwoWayByDefault 256

這個相依性屬性用於資料繫結的 BindingMode ,預設為 TwoWayThe BindingMode for data bindings on this dependency property defaults to TwoWay.

Inherits 32

子項目會繼承這個相依性屬性的值。The values of this dependency property are inherited by child elements.

Journal 1024

這個相依性屬性的值應該由日誌處理序儲存或還原,或在導覽時由統一資源識別項 (URI) 儲存或還原。The values of this dependency property should be saved or restored by journaling processes, or when navigating by Uniform resource identifiers (URIs).

None 0

相依性屬性使用 WPF 屬性系統的預設行為,不指定任何選項。No options are specified; the dependency property uses the default behavior of the WPF property system.

NotDataBindable 128

不允許資料繫結至這個相依性屬性。Data binding to this dependency property is not allowed.

OverridesInheritanceBehavior 64

這個相依性屬性的值會散布在不同的樹狀,以繼承屬性值。The values of this dependency property span separated trees for purposes of property value inheritance.

SubPropertiesDoNotAffectRender 2048

這個相依性屬性值的子屬性對轉譯不會有任何影響。The subproperties on the value of this dependency property do not affect any aspect of rendering.

範例

下列範例會呼叫此FrameworkPropertyMetadata函式, 並使用FrameworkPropertyMetadataOptions列舉中的值來設定數個選項:The following example calls the FrameworkPropertyMetadata constructor and sets several options by using values from the FrameworkPropertyMetadataOptions enumeration:

fpm = new FrameworkPropertyMetadata(
    Double.NaN,
    (FrameworkPropertyMetadataOptions.AffectsRender |
      FrameworkPropertyMetadataOptions.BindsTwoWayByDefault),
    new PropertyChangedCallback(OnCurrentReadingChanged),
    new CoerceValueCallback(CoerceCurrentReading)
);

備註

當您建立FrameworkPropertyMetadata實例時, 請使用此列舉, 而您想要指定一或多個架構層級的中繼資料選項設定。Use this enumeration when you construct a FrameworkPropertyMetadata instance, and you want to specify one or more the framework-level metadata option settings.

您不會再于此函式呼叫之後使用這個列舉。You no longer use this enumeration after the constructor call. 相反地, 請查詢在註冊期間所設定的特定中繼資料選項true , false方法是檢查現有FrameworkPropertyMetadata的特定屬性的或值。Instead, query the particular metadata option that was set during registration by checking the true or false value of a specific property of an existing FrameworkPropertyMetadata. 這些屬性名稱符合 NotDataBindable FrameworkPropertyMetadataOptions以外的列舉值, 其已IsNotDataBindable完成FrameworkPropertyMetadataThese property names match the FrameworkPropertyMetadataOptions enumeration values except for NotDataBindable, which is IsNotDataBindable on the finished FrameworkPropertyMetadata.

Journal選項只會指定要進行日記的目的。The Journal option only specifies the intention to be journaled. 實際的日誌不一定會由日記服務處理, 例如存在於 WPF 檢視器應用程式中的。The actual journaling may or may not be addressed by journaling services such as those that are present in the WPF viewer application. 特別是, 如果專案樹狀結構是透過程式碼而非 XAML 來建立的, 則日誌會有一些已知的限制。In particular, journaling has some known limitations if the element tree was constructed through code rather than XAML. 如需詳細資訊, 請參閱流覽總覽For details, see Navigation Overview.

注意

雖然屬性值繼承可能會因為未附加的相依性屬性而出現, 但未附加的屬性會透過執行時間樹狀結構中的特定專案界限進行的繼承行為是未定義的。Although property value inheritance might appear to work for nonattached dependency properties, the inheritance behavior for a nonattached property through certain element boundaries in the runtime tree is undefined. 請一律使用DependencyProperty.RegisterAttached方法來註冊您在中繼資料FrameworkPropertyMetadata.Inherits中指定的屬性。Always use the DependencyProperty.RegisterAttached method to register properties where you specify FrameworkPropertyMetadata.Inherits in the metadata.

適用於