为什么要在Winforms上使用WPF? WPF是否胜过Winforms? [英] Why should I use WPF over Winforms? Any examples of WPF outperforming Winforms?
问题描述
在 WPF与Windows窗体中有类似的问题,其中有一些很好的信息,但我个人认为经验我认为没有理由在Winforms上使用WPF。最初使用WPF有很多关于它的多线程功能的讨论,但是在使用中我看不到任何好处。
There is a similar question at WPF versus Windows Forms which has some good information but in my personal experience I see no reason to use WPF over Winforms. With WPF initially there was lots of talk about it's multi-threaded functionality but in use I see no benefits.
我有两个应用程序在做相同的事情,其中一个在WPF中然后在Winforms中。 Winforms应用程序在性能方面使WPF应用程序大打折扣(提高了10倍),并且看起来也不错。
I have two applications that do the same thing, one in WPF and on in Winforms. The Winforms application blows the WPF application away in terms of performance (by a factor of 10) and looks just as nice.
已授予我比WPF更精通Winforms应用程序。
Granted I am more proficient in Winforms applications than WPF.
推荐答案
这里还有一个关于此主题的讨论:
Windows Forms何时是WPF的正确选择?
There is another discussion on the subject here: When is Windows Forms the correct choice vs WPF?
Winforms应用程序将WPF
应用程序的性能降低了
(十倍),并且
看起来也不错。
The Winforms application blows the WPF application away in terms of performance (by a factor of 10) and looks just as nice.
WPF不仅仅是花哨的图形...
不是设计师,该死的我对颜色没有感觉(在我的未婚妻决定不再可以买自己的衣服的时候,我还是很喜欢WPF)。例如,对DataBinding的支持令人惊讶,
更不用说为ListBox创建ItemTemplate多么容易了(还记得重写Windows Forms中的draw方法只是为了在ListBox项目中获得两行文本和图像吗?)
WPF is about more than just fancy graphics... I'm not a designer, hell I have no feeling for colors (to a point where my fiancee decided I can no longer buy my own clothes) but I love WPF. DataBinding support for example is amazing not to mention how easy it is to create a ItemTemplate for a ListBox (remember overriding the draw methods in Windows Forms just to get 2 lines of text and an image in a ListBox item?)
至于性能...根据我的经验,只有在将
Windows Vista / 7与GPU配合使用时,改进才会引起注意。 (当然,也是您编写代码的方式。)
As for performance... in my experience the improvement can only be noticed if you're using Windows Vista / 7 with a GPU. (And of course the way you write code).
也许微软误以为WPF完全是粉红色大象图形,而它做的却更多。 (他们在匆忙发行
的Silverlight 1时犯了类似的错误,我认为他们应该一起跳过)。
Perhaps it was a mistake by Microsoft to market that WPF is all about pink elephant graphics while it does so much more. (They made a similar mistake with the rushed release of Silverlight 1, which in my opinion they should have skipped all together).
这篇关于为什么要在Winforms上使用WPF? WPF是否胜过Winforms?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!