winform中是否存在命令? [英] Do commands exists in winform?

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

问题描述



目前我正在使用WPF并使用大量命令,但有一个问题,

winform中是否存在命令?如果是,那么如何在winform中实现它们?



提前致谢



我尝试了什么:



我想在winform中实现命令,但不知道如何实现它

Hi,
currently I am working on WPF and using lot of commands but have one question,
Do Commands exists in winform? and if yes then how to implement them in winform??

Thanks in advance

What I have tried:

I want to implement commands in winform but does not know how to implement it

推荐答案

CodePlex上有一个项目,作者在WinForms中完成了命令的自定义实现。它只是一个侧面项目,仅列在下载概述下: WPF应用框架(WAF) [ ^ ](参见WAF Windows Forms Adapter 1.0.0.1下的实验)。我刚才检查过它并且运行正常。
There's a project on CodePlex where the author has done a custom implementation of commands in WinForms. It's only a side-project and only listed under "Downloads overview": WPF Application Framework (WAF)[^] (see "WAF Windows Forms Adapter 1.0.0.1" under "Experimental"). I checked it out a while ago and it worked fine.


Windows Forms有Events / EventHandlers,WPF有命令。虽然你可以说WinForms Events / EventHandlers提供与WPF命令相同的功能......处理用户交互......这两个技术堆栈具有非常不同的架构。 WPF实现事件冒泡:WinForms没有,等等。



有一些尝试让WinForms拥有WPF所做的一些命令模式goodness,但是,imho,这些一般都是黑客攻击。 CodeProject上有很多文章为Win Forms提供某种MVP框架。



本文可能会为您阐明一些主要区别:[< a href =http://www.developerhandbook.com/wpf-mvvm/wpf-mvvm-for-winforms-devs-part-4-of-5/target =_ blanktitle =New Window> ^ ]。
Windows Forms has Events/EventHandlers, WPF has Commands. While you can kind-of say that WinForms Events/EventHandlers serve the same function as WPF Commands ... handling user interaction ... these two technology stacks have very different architectures. WPF implements "event bubbling:" WinForms does not, etc.

There are some attempts to make WinForms have some of the command pattern "goodness" that WPF does, but, imho, these in general are hacks. There are a lot of articles here on CodeProject that offer some kind of MVP framework for Win Forms.

This article may clarify some of the key differences for you: [^].


Windows窗体中不存在命令。
"Commands" don't exist in Windows Forms.


这篇关于winform中是否存在命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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