如何将 WPF 中的命令绑定到控件的双击事件处理程序? [英] How to bind a command in WPF to a double click event handler of a control?
本文介绍了如何将 WPF 中的命令绑定到控件的双击事件处理程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要将文本块的双击事件(或者也可能是图像 - 无论哪种方式,它都是用户控件)绑定到我的 ViewModel 中的命令.
I need to bind the double click event of a textblock (or potentially an image as well - either way, its a user control), to a command in my ViewModel.
TextBlock.InputBindings 似乎没有正确绑定到我的命令,有什么帮助吗?
TextBlock.InputBindings does not seem to bind correctly to my commands, any help?
推荐答案
试试 Marlon Grech 的 附加命令行为.
Try Marlon Grech's attached command behaviors.
这篇关于如何将 WPF 中的命令绑定到控件的双击事件处理程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文