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

推荐订阅源

Google DeepMind News
Google DeepMind News
博客园_首页
H
Help Net Security
T
Tailwind CSS Blog
S
SegmentFault 最新的问题
GbyAI
GbyAI
Scott Helme
Scott Helme
D
Docker
Hacker News: Ask HN
Hacker News: Ask HN
P
Privacy & Cybersecurity Law Blog
Jina AI
Jina AI
雷峰网
雷峰网
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Spread Privacy
Spread Privacy
G
GRAHAM CLULEY
C
Cisco Blogs
The Hacker News
The Hacker News
F
Full Disclosure
Y
Y Combinator Blog
Blog — PlanetScale
Blog — PlanetScale
Recent Announcements
Recent Announcements
G
Google Developers Blog
量子位
K
Kaspersky official blog
Cisco Talos Blog
Cisco Talos Blog
The Cloudflare Blog
A
About on SuperTechFans
C
Cybersecurity and Infrastructure Security Agency CISA
Last Week in AI
Last Week in AI
博客园 - 三生石上(FineUI控件)
Microsoft Security Blog
Microsoft Security Blog
Martin Fowler
Martin Fowler
T
Tenable Blog
P
Palo Alto Networks Blog
H
Heimdal Security Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
W
WeLiveSecurity
Schneier on Security
Schneier on Security
The Register - Security
The Register - Security
F
Fortinet All Blogs
Stack Overflow Blog
Stack Overflow Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
The Blog of Author Tim Ferriss
N
News and Events Feed by Topic
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
V
V2EX
爱范儿
爱范儿

博客园 - sizzle

ruby函数回调的实现方法 软件单元测试之我见 非空判断 在COM中使用数组参数-SafeArray[转载] 指针赋值 - sizzle - 博客园 进程的深度隐藏 文件隐藏 Windows下网络数据报的监听和拦截技术 三键屏蔽 键盘知识 如何获取当前程序文件的路径 Net Remoting[转自Bruce Zhang's Blog] 解码 XML 和 DTD 【读书笔记】[Effective C++第3版][第27条]尽量不要使用类型转换 P2P之UDP穿透NAT的原理与实现 窗体显示中Form.Show()和Form.ShowDialog()的区别 一段高深代码--未解 使用C#注销/关闭计算机 TEA加密算法的C/C++实现
CommandBinding用法
sizzle · 2007-09-13 · via 博客园 - sizzle

.cs文件中用法 

private void BindCommands()
        {
            //[OK]
            CommandBinding cb = new CommandBinding(Commands.OK, OnOK);
            this.CommandBindings.Add(cb);
            this.OkButton.Command = Commands.OK;
            //[CANCEL]
            cb = new CommandBinding(Commands.Cancel, OnCancel);
            this.CommandBindings.Add(cb);
            this.CancelButton.Command = Commands.Cancel;          
        }

然后在构造函数中调用即可。 

.xmal中用法

先在.cs文件中定义:        public static RoutedCommand CloseCommand = new RoutedCommand();

  <Window.CommandBindings>
    <CommandBinding Command="path:fileName.CloseCommand" Executed="Click_OK"/>
  </Window.CommandBindings>
  <Window.InputBindings>
    <KeyBinding Command="path:fileName.CloseCommand" Gesture="Escape"/>
    <KeyBinding Command="path:fileName.CloseCommand" Gesture="Enter"/>
  </Window.InputBindings>