自建C#工程(Button按钮添加快捷键)
这里主要说的是Button按钮添加快捷键。
我是也一面在网上查资料,一面自己总结,我这些也是查了很多资料才总结出来的,网上的关于Button添加快捷方式的资料很多,也很杂。我也是花了好长时间来验证才最终成功,大概查了得有3个多小时的内容才搞定,希望能对和我有同样需求的人一些帮助,不要像我走了很多弯路,也没有经验,也没有人能指导你,真的是一团乱麻。
1、Wpf窗口(一部分来源于网络)
<Window x:Class="smart_home_server.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:smart_home_server"
mc:Ignorable="d"
Title="Smart Home-Server" Height="377.334" Width="572.927" Icon="Image/xj.ico" WindowStartupLocation="CenterScreen" WindowState="Maximized">
<!--
Title(设置软件名称)
Icon(设置软件图标)
WindowsStartupLocation(设置软件的启动后所在的位置)
WindowState(设置软件启动后的状态(最大化、最小化等))
-->
<Window.Resources>
<RoutedUICommand x:Key=