zoukankan      html  css  js  c++  java
  • 笔记

    1.故事板的时间定义,之前一直没看懂 表示为时分秒
    <DoubleAnimation 
                    Storyboard.TargetName="MyRectangle"
                    Storyboard.TargetProperty="Width"
                    From="100" To="200" Duration="0:0:1" />
    
    Duration="0:0:1"  表示 时:分:秒
    2.路径说明
    <Path Data="M0 0 12 12M0 12 12 0" Stroke="White" StrokeThickness="1" VerticalAlignment="Center" HorizontalAlignment="Center">
    
    Data 中M 为move 即移动到(0,0) 画线到(12,12) 在移动到(0,12) 画线(12,0) ,中间M为移动到,如果没有的话  会直接画线
    以上为画一个X 
    3.代码片段
    vs->工具->代码片段管理器 打开后
    切换语言为Cshape,复制位置的路径,在资源管理器中打开。
    创建代码片段即可。
    本例:复制一个propfull  改名为propn 
    打开propn  修改文件里面的propfull->probn
    <Title>propn</Title>
    <Shortcut>propn</Shortcut>
    public $type$ $property$
        {
            get { return $field$;}
            set { $field$ = value;this.DoNotify();}
        }
        $end$]]>
    4.增加(CallerMemberNameAttribute/CallerFilePathAttribute/CallerLineNumberAttribute)这3个特性
    
    这3个特性是.net 4.5中新增的,如果要在低版本中使用,需要增加,类
    namespace System.Runtime.CompilerServices
    {
        [AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
        public class CallerMemberNameAttribute : Attribute
        {
    
        }
    
        [AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
        public class CallerFilePathAttribute : Attribute
        {
    
        }
    
        [AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
        public class CallerLineNumberAttribute : Attribute
        {
    
        }
    }
    
    在通知属性接口基类中,增加特性限定,可以自动识别属性名称,减少复制代码后忘记修改报错的尴尬。
    
     public class NotifyBase : INotifyPropertyChanged
        {
            public event PropertyChangedEventHandler PropertyChanged;
            public void DoNotify([CallerMemberName] string propName="")
            {
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propName));
            }
        }
    
        public class UserInfo:NotifyBase
        {
            private int age;
    
            public int Age
            {
                get { return age; }
                set { age = value; this.DoNotify(); }
            }
            private string name;
    
            public string Name
            {
                get { return name; }
                set { name = value; this.DoNotify(); }
            }
    
        }
  • 相关阅读:
    PDA智能程序访问WebService,报告“未能建立与网络的连接”
    VS2008中开发智能设备程序的一些总结收藏
    Error: The INF file contains Unicode characters that could not be converted correctly
    在vs2008工程中制作cab包
    linux专题三之如何悄悄破解root密码(以redhat7.2x64为例)
    linux专题一之文件描述符、重定向、管道符、tee命令
    linux的计划
    如何安装RHEL7.2x64 即红帽7.2虚拟机?
    快速排序及查找第K个大的数。
    来来来,做道题,一起防老年痴呆
  • 原文地址:https://www.cnblogs.com/ankeyliu/p/14749321.html
Copyright © 2011-2022 走看看