一、通过双击或者快捷键触发Command事件
<Button Content="Button"> <Button.InputBindings> <MouseBinding MouseAction="LeftDoubleClick" Command="{Binding Btn1Command}" CommandParameter="123"/> <KeyBinding Key="Q" Modifiers="Alt" Command="{Binding Btn1Command}" CommandParameter="123"/> </Button.InputBindings> </Button>
MouseBinding 中的MouseAction还有如下操作:
单击鼠标左键 :LeftClick
双击鼠标左键:LeftDoubleClick
单击鼠标中键 :MiddleClick
双击鼠标中键:MiddleDoubleClick
单击鼠标右键:RightClick
双击鼠标右键:RightDoubleClick
不执行任何操作:None
旋转鼠标滚轮:WheelClick
出处:https://blog.csdn.net/songhuangong123/article/details/126317592
标签:鼠标,单击,Button,汇总,双击鼠标,右键,WPF,左键 From: https://www.cnblogs.com/Mars-0603/p/17078147.html