如何将WPF中的命令绑定到控件的双击事件处理程序? [英] How to bind a command in WPF to a double click event handler of a control?

查看:159
本文介绍了如何将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屋!

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