zoukankan      html  css  js  c++  java
  • wpf Route Event Code Snippet

    将下面内容保存为snippet后缀文件,通过vs的代码片段管理工具导入即可,快捷键请按需修改:

    <?xml version="1.0" encoding="utf-8" ?>
    <CodeSnippets  xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
        <CodeSnippet Format="1.0.0">
            <Header>
                <Title>创建路由事件</Title>
                <Shortcut>revt</Shortcut>
                <Description>创建route ev</Description>
                <Author>虫子樱桃</Author>
                <SnippetTypes>
                    <SnippetType>Expansion</SnippetType>
                </SnippetTypes>
            </Header>
            <Snippet>
                <Declarations>
                    <Literal>
            <ID>type</ID>
            <ToolTip>属性类型</ToolTip>
            <Default>EventHandler</Default>
          </Literal>
          <Literal>
            <ID>RoutedEventName</ID>
            <ToolTip>属性名</ToolTip>
            <Default>MyEvent</Default>
          </Literal>
                </Declarations>
                <Code Language="csharp">
                    <![CDATA[
                    
     public event $type$ $RoutedEventName$
          {
          add{ AddHandler($RoutedEventName$Event, value); }
          remove{ RemoveHandler($RoutedEventName$Event, value); }
          }
          
          public static readonly RoutedEvent $RoutedEventName$Event=EventManager.RegisterRoutedEvent(
          "$RoutedEventName$",RoutingStrategy.Bubble,typeof($type$),typeof(myclass));
          ]]>
                </Code>
            </Snippet>
        </CodeSnippet>
    </CodeSnippets>
  • 相关阅读:
    day25:接口类和抽象类
    vue1
    How the weather influences your mood?
    机器学习实验方法与原理
    How human activities damage the environment
    Slow food
    Brief Introduction to Esports
    Massive open online course (MOOC)
    Online learning in higher education
    Tensorflow Dataset API
  • 原文地址:https://www.cnblogs.com/czytcn/p/8482167.html
Copyright © 2011-2022 走看看