zoukankan      html  css  js  c++  java
  • Some tips

    1. UIPropertyMetadata and FrameworkPropertyMetadata

    • UIPropertyMetaData Provides property metadata for non-framework properties that do have rendering/user interface impact at the core level.

    构造函数: 

     UIPropertyMetadata()
     UIPropertyMetadata(default Object)  
     UIPropertyMetadata(PropertyChangedCallback) 
     UIPropertyMetadata(default Object, PropertyChangedCallback) 
     UIPropertyMetadata(default Object, PropertyChangedCallback, CoerceValueCallback) 

     UIPropertyMetadata(Object, PropertyChangedCallback, CoerceValueCallback, Boolean) a Boolean used to disable animations on the property.

    UIElement主要负责路由事件,命令帮定,布局,焦点的可视对象基类。

    • FrameworkPropertyMetadata:UIPropertyMetadata

    FrameworkPropertyMetadata Reports or applies metadata for a dependency property, specifically adding framework-specific property system characteristics.

     FrameworkPropertyMetadata 最大的优势是有一个FrameworkPropertyMetadataOptions在构造函数中 ,

    These options specify characteristics of the dependency property that interact with systems such as layout or data binding. Can be Combination of optiongs below:

     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. 

    使用:FrameworkPropertyMetadataOptions.AffectsRender |
          FrameworkPropertyMetadataOptions.BindsTwoWayByDefault),

    FrameworkElement支持样式,数据帮定,资源和一些通用机制的windows控件,如tooltip, contextmenu等。

    2。 How to new line in xaml string attribute

    <LineBreak/>   or  

  • 相关阅读:
    Linux下将pycharm图标添加至桌面
    在linux命令下如何访问一个url?
    sudo 出现unable to resolve host 解决方法
    时间处理插件moment.js
    vue视图不更新情况详解
    基于webstorm卡顿问题的2种解决方法
    Windows10内置Linux子系统
    VUE项目中使用this.$forceUpdate();解决页面v-for中修改item属性值后页面v-if不改变的问题
    vue $forceUpdate() 强制重新渲染
    Vue 实现手动刷新组件
  • 原文地址:https://www.cnblogs.com/liangouyang/p/1331470.html
Copyright © 2011-2022 走看看