http://blog.sina.com.cn/s/blog_4c0e8aa20100ung8.html
2015-07-28 11:31
513 查看
因此我采用的是另一种方式,也是在网上查找的,不过网址个忘了,现在只剩下程序了。
实现的办法如下所示:
<Window.Resources>
<RoutedUICommand x:Key="searchKey" Text="FaskDemo"
/>
</Window.Resources>
<windows.inputBindings>
<KeyBinding Command="{StaticResource
searchKey}" Key="F3"/> </windows.inputBindings>
<Window.CommandBindings>
<CommandBinding
Command="{StaticResource searchKey}" CanExecute="CommandBinding_CanExecute_F3"
"/>
</Window.CommandBindings>
这是前面的xmal要做的事情,当然,我们要执行的那个FaskDemo_Click我们还的实现以下啊,那么就如下所示了:
private void CommandBinding_CanExecute_F3(object sender, CanExecuteRoutedEventArgs e)
{
Console.WriteLine("LeoZhao 讲鬼故事");
}
这样就OK了。
实现的办法如下所示:
<Window.Resources>
<RoutedUICommand x:Key="searchKey" Text="FaskDemo"
/>
</Window.Resources>
<windows.inputBindings>
<KeyBinding Command="{StaticResource
searchKey}" Key="F3"/> </windows.inputBindings>
<Window.CommandBindings>
<CommandBinding
Command="{StaticResource searchKey}" CanExecute="CommandBinding_CanExecute_F3"
"/>
</Window.CommandBindings>
这是前面的xmal要做的事情,当然,我们要执行的那个FaskDemo_Click我们还的实现以下啊,那么就如下所示了:
private void CommandBinding_CanExecute_F3(object sender, CanExecuteRoutedEventArgs e)
{
Console.WriteLine("LeoZhao 讲鬼故事");
}
这样就OK了。
相关文章推荐
- WebService或HTTP服务端接收请求转发消息到另一个服务端-实现思路
- 人工神经网络基础与研究内容
- uboot启动完成后对网络环境的配置
- python实现单隐层神经网络基本模型 推荐
- 网络编程系列之二 互斥量
- tomcat7 服务器配置HTTPS安全协议
- 网络爬虫基本原理(一)
- 网络爬虫基本原理二
- 1149-PIGS(网络流建模,缩点)
- 自组织神经网络的实现
- Nmap新增脚本http-svn-enum和http-svn-info
- Linux网络编程select模型的实现
- ProtoBuf
- https 对接非对称密钥加密 MD5及数字签名相关
- TCP and UDP Small Servers
- 【iOS】MD5加密与网络数据安全
- 网络请求之GET、POST请求
- http错误码
- https://123.56.95.148/svn/Source/secretary
- 7月第3周网络安全报告:应用程序漏洞居首 涨27.7%