绑定命令到活动? [英] Binding Commands to Events?

查看:150
本文介绍了绑定命令到活动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是命令绑定到一个事件好方法?在我的WPF应用程序,有我想捕捉的事件和过程我的ViewModel,但我不知道如何。就像失去焦点,鼠标悬停,鼠标移动,等事情既然我试图坚持MVVM模式,我想知道是否有一个纯粹的XAML的解决方案。

What's a good method to bind Commands to Events? In my WPF app, there are events that I'd like to capture and process by my ViewModel but I'm not sure how. Things like losing focus, mouseover, mousemove, etc. Since I'm trying to adhere to the MVVM pattern, I'm wondering if there's a pure XAML solution.

谢谢!

推荐答案

有一个在马龙格列奇的的附加命令行为,也可能是你在寻找什么。

Have a look at Marlon Grech's Attached Command Behaviour, it could be exactly what you're looking for

这篇关于绑定命令到活动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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