zoukankan      html  css  js  c++  java
  • 使用DependencyObject的例子

    在WinFX3.0整个UI的所有对象中,使用了DependencyObject对象,他简化了标准属性控制的流程。为XAML提供了基础支持

    下面是使用这个对象的标准例子。
        /// <summary>
        
    /// 使用DependencyObject的例子,定义了一个订单
        
    /// </summary>

        public class OrderSheet : DependencyObject {
            
            
    public static readonly DependencyProperty CodeProperty;

            
    /// <summary>
            
    /// 在静态构造中注册属性到此类型
            
    /// </summary>

            static OrderSheet() {
                CodeProperty 
    = DependencyProperty.Register("Code"typeof(string), typeof(OrderSheet));
            }


            
    /// <summary>
            
    /// 返回/设置单据的编号
            
    /// </summary>

            public string Code {
                
    get {
                    
    return (string)GetValue(CodeProperty);
                }

                
    set {
                    SetValue(CodeProperty, value);
                }

            }

        }
  • 相关阅读:
    Navicat工具破解
    ios7开发者必知
    浏览器工作原理
    Lettcode_104_Maximum Depth of Binary Tree
    LeetCode:Balanced Binary Tree
    error: openssl/md5.h: No such file or directory
    欢迎来到Swift天地(Welcome to Swift)
    最大子阵列和
    【Cocos2d-x Lua】数据库封装类型的操作
    python于lxml应用
  • 原文地址:https://www.cnblogs.com/tansm/p/469915.html
Copyright © 2011-2022 走看看