• 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  

  • 相关阅读:
    [AS3 3D Demo] Stage3D学习过程中开发的3个Demo
    NGUI学习笔记(一):官方视频学习记录
    关于继承MonoBehaviour的一些记录
    Jquery js框架使用
    Highcharts 图表js框架
    js上传控件 plupload 使用记录
    关于 web中 使用 java.net.URLEncoder.encode 要编码两次呢 , js的encodeURIComponent 同理
    跑测试没有web环境的情况
    sitemesh 学习之 meta 引入
    sitemesh 2.4 装饰器学习
  • 原文地址:https://www.cnblogs.com/liangouyang/p/1331470.html
Copyright © 2020-2023  润新知