使用MVVM和viewmodel的WPF应用程序需要处理select [英] WPF application with MVVM and in viewmodel need to handle on select

查看:48
本文介绍了使用MVVM和viewmodel的WPF应用程序需要处理select的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



首次尝试使用wpf app :-)



我正在开发wpf我正在使用MVVM模式的应用程序。

现在我选择了事件节点并且我正在做一些操作。

这个事件的事件给我一个我有的节点选择。



现在我想把这个选定的事件处理代码移动到viewmodel和

我想要的事件也在命令。



请建议最佳方式。



谢谢&问候

Sne

Hi All,

First attempt to wpf app :-)

I am developing wpf application where I am using MVVM pattern.
Now I have event nodeselected and on that I am doing some operation.
The eventargs of this event give me the node which I have selected.

Now I want to move this selected event handling code to viewmodel and
I want the eventargs also in command.

Please suggest the best way to do it.

Thanks & Regards
Sne

推荐答案

您好 this EventToCommandBehavior



Hi Try this EventToCommandBehavior

<i:interaction.behaviors >
<vm:eventtocommandbehavior command="{Binding DataGridError}" event="XlationError" passarguments="True" />
</i:interaction.behaviors>


这篇关于使用MVVM和viewmodel的WPF应用程序需要处理select的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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