惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Recent Announcements
Recent Announcements
雷峰网
雷峰网
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Hugging Face - Blog
Hugging Face - Blog
博客园 - 司徒正美
人人都是产品经理
人人都是产品经理
博客园 - 【当耐特】
量子位
有赞技术团队
有赞技术团队
博客园 - 三生石上(FineUI控件)
博客园 - Franky
M
MIT News - Artificial intelligence
U
Unit 42
Last Week in AI
Last Week in AI
酷 壳 – CoolShell
酷 壳 – CoolShell
The Cloudflare Blog
J
Java Code Geeks
V
Visual Studio Blog
Engineering at Meta
Engineering at Meta
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
MyScale Blog
MyScale Blog
T
Tailwind CSS Blog
T
The Blog of Author Tim Ferriss
V
V2EX

博客园 - 取经路上

IIS 下发布SignalR 访问接口进不去处理 Linux下部署.Net 应用程序和Web应用程序 CentOS 7 配置启动 手动编译的 nginx CentOS 7 nginx 安装 sticky模块 关于SignalR并发量测试 C# 调用迅雷aplayer播放器的遇到的问题总结 C# 采用HttpWebRequest 、WebClient和HttpClient下载https的文件异常问题 C# 判别系统版本以及Win10的识别办法 MVC ActionResult 视图模型 MVC 前后台传值 MVC基础关键点 sqlserver 数据库、日志文件收缩 vue-cli启动报错问题: IE6无法获取class属性 windows server 2008 r2 datacenter 共享服务找不到网络路径解决办法 在Visual Studio 中的监视窗口中监视Com对象变量 删除GitHub上项目中的某个文件 转 WPF MVVM 循序渐进 (从基础到高级) 服务器未能识别 HTTP 头 SOAPAction 的值: http://tempuri.org/QueryUserName。
笔记
取经路上 · 2021-05-09 · via 博客园 - 取经路上
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(); }
        }

    }