如果我们无法绑定MouseBinding的命令,我们应该怎么做? [英] If we can't bind a MouseBinding's Command, what are we supposed to do?
本文介绍了如果我们无法绑定MouseBinding的命令,我们应该怎么做?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望能够使用常规的MouseBinding
捕获TextBlock
上的CTRL-Click事件.不幸的是Command
属性不是依赖项属性,我正在使用MVVM,因此无法将其绑定到我的viewmodel.
I would love to be able to use a regular MouseBinding
to capture a CTRL-Click event on my TextBlock
. Unfortunately the Command
property is not a dependency property and I'm using MVVM, so I can't bind it to my viewmodel.
Microsoft如何遗漏此基本功能?没有简单的方法来检测CTRL-Clicks并将它们绑定到我的视图模型中的命令吗?
How could Microsoft have left out this basic functionality? Are there no easy ways to detect CTRL-Clicks and bind them to a command in my viewmodel?
推荐答案
您始终可以使用 查看全文