WPF中命令之间的区别 [英] Difference between Commands in WPF

查看:116
本文介绍了WPF中命令之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这些WPF命令之间有什么区别:

路由命令,路由UI命令,中继命令和ICommand.

在开发应用MVVM的应用程序时,如何选择应使用哪个.

What is difference between these WPF Commands:

Routed Command, Routed UI Command, Relay Command and ICommand.

While developing application of applying MVVM how to choose which one should be used.

推荐答案

ICommand是在bot Routed Command和Routed IU Command中实现的接口,请参见此处:
http://msdn.microsoft.com/en-us/library/system. windows.input.icommand.aspx [ ^ ]

这意味着Routed Command和Routed UI Command只是在其中实现命令界面的两个不同类.请查看文档:
http://msdn.microsoft.com/en-us/library/system. windows.input.routedcommand.aspx [ ^ ]
http://msdn.microsoft.com/en-us/library/system. windows.input.routeduicommand.aspx [ ^ ]

这是乔希·史密斯(Josh Smith)关于MVVM模式的文章,可能也对您有用:
http://msdn.microsoft.com/en-us/magazine/dd419663.aspx [ ^ ]
The ICommand is a interface that is implemented in bot Routed Command and Routed IU Command, see here:
http://msdn.microsoft.com/en-us/library/system.windows.input.icommand.aspx[^]

This would mean that the Routed Command and the Routed UI Command is simply two different classes of implementing the command interface in. Take a look in the documentation:
http://msdn.microsoft.com/en-us/library/system.windows.input.routedcommand.aspx[^]
http://msdn.microsoft.com/en-us/library/system.windows.input.routeduicommand.aspx[^]

Here is an articlw from Josh Smith on the MVVM pattern that might also be useful to you:
http://msdn.microsoft.com/en-us/magazine/dd419663.aspx[^]


这篇关于WPF中命令之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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