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

查看:736
本文介绍了如何将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的< =http://marlongrech.wordpress.com/2008/12/13/attachedcommandbehavior-v2-aka-acb/ =nofollow noreferrer>附加的命令行为。

Try Marlon Grech's attached command behaviors.

这篇关于如何将WPF中的命令绑定到控件的双击事件处理程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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