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现有FrameworkPropertyMetadata的特定属性的或false值来查询在注册过程中设置的特定元数据选项。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. 这些属性名称与FrameworkPropertyMetadataOptions枚举值匹配, 但 NotDataBindable 除外, 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.

适用于