DelegateCommand与RoutedCommand和手势-WPF [英] DelegateCommand vs RoutedCommand and gestures - WPF

查看:132
本文介绍了DelegateCommand与RoutedCommand和手势-WPF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在构建复合WPF应用程序时,DelegateCommand是否支持手势?我正在尝试创建一个由MenuItem和一个Button使用的命令,可以通过键盘快捷键访问它,但是它位于单独的程序集中的类中.

is there anyway for DelegateCommand's to support gestures when building a composite WPF app? I'm trying to create a command used by a MenuItem and also a Button, which can be accessed through a keyboard shortcut, but which sits inside a class in a separate assembly.

我可以使用RoutedCommand,但是我想最小化任何隐藏的代码.

I can use a RoutedCommand, but I want to minimise any code-behind.

推荐答案

使用 InputBindingCollection 以使用ICommand映射手势.

Use InputBindingCollection to map gestures with ICommand.

这篇关于DelegateCommand与RoutedCommand和手势-WPF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆