扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者: 2007年11月25日
关键字: 元数据
在本页阅读全文(共19页)
FrameworkPropertyMetadataOptions Enumeration:
Specifies the types of framework-level property behavior that pertain to a particular dependency property in the Windows Presentation Foundation (WPF) property system.
Member name | Description | |
---|---|---|
None | No options are specified; the dependency property uses the default behavior of the Windows Presentation Foundation (WPF) property system. | |
AffectsMeasure | The measure pass of layout compositions is affected by value changes to this dependency property. | |
AffectsArrange | The arrange pass of layout composition is affected by value changes to this dependency property. | |
AffectsParentMeasure | The measure pass on the parent element is affected by value changes to this dependency property. | |
AffectsParentArrange | The arrange pass on the parent element is affected by value changes to this dependency property. | |
AffectsRender | Some aspect of rendering or layout composition (other than measure or arrange) is affected by value changes to this dependency property. | |
Inherits | The values of this dependency property are inherited by child elements. | |
OverridesInheritanceBehavior | The values of this dependency property span separated trees for purposes of property value inheritance. | |
NotDataBindable | Data binding to this dependency property is not allowed. | |
BindsTwoWayByDefault | The BindingMode for data bindings on this dependency property defaults to TwoWay. | |
Journal | The values of this dependency property should be saved or restored by journaling processes, or when navigating by Uniform resource identifiers (URIs). | |
SubPropertiesDoNotAffectRender | The subproperties on the value of this dependency property do not affect any aspect of rendering. |
Setting Appropriate Metadata Flags
If your property (and value changes to it) affects the user interface (UI), and in particular affects how the layout system should size or render your element in a page, set one or more of the following flags: AffectsMeasure, AffectsArrange, AffectsRender.
AffectsMeasure indicates that a change to this property requires a change to UI rendering where the containing object might require more or less space within the parent. For example, a "Width" property should have this flag set.
AffectsArrange indicates that a change to this property requires a change to UI rendering that typically does not require a change in the dedicated space, but does indicate that the positioning within the space has changed. For example, an "Alignment" property should have this flag set.
These flags are often used as a protocol in metadata for your own override implementations of property system or layout callbacks. For instance, you might have an
Some properties may affect the rendering characteristics of the containing parent element, in ways above and beyond the changes in required size mentioned above. An example is the
By default, dependency properties support data binding. You can deliberately disable data binding, for cases where there is no realistic scenario for data binding, or where performance in data binding for a large object is recognized as a problem.
By default, data binding
You can also enable property inheritance in a custom dependency property by setting the
Set the
暂时摘抄于此,有空细述。
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1901805
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者