中如何选择合适的元数据标记英文物业
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 nameDescriptionNoneNo options are specified; the dependency property uses the default behavior of the Windows Presentation Foundation (WPF) property fectsMeasureThe measure pass of layout compositions is affected by value changes to this dependency property. AffectsArrangeThe arrange pass of layout composition is affected by value changes to this dependency property. AffectsParentMeasureThe measure pass on the parent element is affected by value changes to this dependency fectsParentArrangeThe arrange pass on the parent element is affected by value changes to this dependency fectsRenderSome aspect of rendering or layout composition (other than measure or arrange) is affected by value changes to this dependency heritsThe values of this dependency property are inherited by child erridesInheritanceBehaviorThe values of this dependency property span separated trees for purposes of property value inheritance. NotDataBindableData binding to this dependency property is not ndsTwoWayByDefaultThe BindingMode for data bindings on this dependency property defaults to urnalThe values of this dependency property should be saved or restored by journaling processes, or when navigating by Uniform resource identifiers (URIs). SubPropertiesDoNotAffectRenderThe 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.
AffectsRender indicates that some other change has occurred that will not affect layout and measure, but does require another render. An example would be a property that changes a color of an existing element, such as \"Background\".
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 OnPropertyChanged callback that will call InvalidateArrange if any property of the instance reports a value change and has AffectsArrange as true in its metadata.
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 MinOrphanLines property used in the flow document model, where changes to that property can change the overall rendering of the flow document that contains the paragraph. Use AffectsParentArrange or AffectsParentMeasure to identify similar cases in your own properties.
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 Mode for dependency properties defaults to OneWay. You can always change the binding to be TwoWay per binding instance; for details, see How to: Specify the Direction of the Binding. But as the dependency property author, you can choose to make the property use TwoWay binding mode by default. Examples in existing dependency properties include ; the scenario for this property is that the IsSubmenuOpen setting logic and the compositing of MenuItem interact with the default theme style. The IsSubmenuOpen property logic uses data binding natively to maintain the state of the property in accordance to other state properties and method calls. Another example property that binds TwoWay by default is xt.
You can also enable property inheritance in a custom dependency property by setting the Inherits flag. Property inheritance is useful for a scenario where parent elements and child elements have a property in common, and it makes sense for the child elements to have that particular property value set to the same value as the parent set it. An example inheritable property is DataContext, which is used for binding operations to enable the important master-detail scenario for data presentation. By making DataContext inheritable, any child elements inherit that data context also. Because of property value inheritance, you can specify a data context at the page or application root, and do not need to respecify it for bindings in all possible child elements. DataContext is also a good example to illustrate that inheritance overrides the default value, but it can always be set locally on any particular child element; for details, see How to: Use the Master-Detail Pattern with Hierarchical Data. Property value inheritance does have a possible performance cost, and thus should be used sparingly; for details, see Property Value Inheritance.
Set the Journal flag to indicate if your dependency property should be detected or used by navigation journaling services. An example is the SelectedIndex property; any item selected in a selection control should be persisted when the journaling history is navigated.
暂时摘抄于此,有空细述。
Trackback:
小孩积食怎么办吉林治疗白癜风医院哪家好
西宁治疗妇科哪好
- 03-13[游戏]凯特生母被发现,同一款西装有不同颜色!
- 03-02[游戏]迎战中考!北京非涉疫初三同学今日返校
- 02-21[游戏]2022招生预测分数线出炉?
- 02-19[游戏]纪录片客串最主要的三大类型
- 02-09[游戏]“包”过!李沧这位班主任手绘帆布包给中高考送上祝福
- 01-23[游戏]兴齐眼药(300573.SZ)连续大跌超30% 对近视“神药”阿托品滴眼液的命运 母公司只回应“生产
- 01-20[游戏]联赢激光:拟订增募资不超过9.9亿元
- 01-13[游戏]消息称惠普将上架战X 2022 14 英寸锐龙版:搭载 R7 6800HS
- 01-09[游戏]古装高马尾还是要看这几位:朱一龙翩翩公子,看不到肖战彻底惊艳
- 12-28[游戏]想申请TOP商学院毕业生必不可少的,你还不知道?
- 12-21[游戏]包皮环切手术什么年龄继续做比较合适?
- 12-16[游戏]宏碁面世新款TravelMate:升级 12 代酷睿 vPro 和锐龙 6000 Pro
- 12-15[游戏]兴齐眼药(300573.SZ)连续大跌超30% 对近视“神药”阿托品滴眼液的命运 母公司只回应“生产