Why should I use WPF over Winforms? Any examples of WPF outperforming Winforms?

后端 未结 5 791
情深已故
情深已故 2020-12-29 09:24

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 init

5条回答
  •  暖寄归人
    2020-12-29 10:07

    There is another discussion on the subject here: When is Windows Forms the correct choice vs WPF?

    The Winforms application blows the WPF application away in terms of performance (by a factor of 10) and looks just as nice.

    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?)

    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).

    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).

提交回复
热议问题