68

I've developed Windows Forms applications for 5 years now. A lot of people say that I should look into WPF. I have a few questions about WPF vs Windows Forms to determine which one is best. WPF is newer than Windows Forms and many people say it'll be the future. Others say that Windows Forms is older and therefor more secure. I am not sure what will be the future. I have googled advantages and disadvantages, but I hope that you can give me a more in dept answer to these questions:

  1. Which one is better based upon performance?
  2. What are the top advantages of using WPF instead of Windows Forms?
  3. What are the top advantages of using Windows Forms instead of WPF?
  4. Which one is more used/liked by businesses?
  5. How hard is it to switch from Windows Forms to WPF?
  6. Which parts of WPF should I definitely look into?
4
  • 1
    Partial answer: 5. WPF has a pretty steep learning curve, because it is very different from windows forms.
    – DrKoch
    Jul 1, 2015 at 6:51
  • More secure is something I disagree with, there isn't anything in winforms at all to make it more secure and if anything it could be less secure since you sometimes need old versions of apis to work with it (thats just an age thing though). The rest of your question is still broad
    – Sayse
    Jul 1, 2015 at 6:54
  • DrKoch, what is the hard part? Xaml, data binding, etc. ? Jul 1, 2015 at 6:56
  • 3
    This site gives a decent short one vs the other I found interesting: educba.com/winforms-vs-wpf Sep 7, 2019 at 18:13

1 Answer 1

72
  1. There is no meaning to say that WPF is better than windows forms or vice versa. It depends on many factors:

    • What kind of UI you are building. Obviously, the complexity of the views you are designing will factor in to performance on both platforms. They have different layout and rendering pipelines.

    • How effectively you optimize for performance on each platform.

  2. Advantages of using WPF instead of Windows forms:

    • XAML makes it easy to create and edit your GUI, and allows the work to be split between a designer (XAML) and a programmer (C#, VB.NET etc.).

    • It allows you to make user interfaces for both Windows applications and web applications (Silverlight/XBAP).

    • Databinding, which allows you to get a more clean separation of data and layout.

    • Uses hardware acceleration for drawing the GUI, for better performance.

  3. Top advantages of using Windows forms instead of WPF:

    • WPF's in-box control suite is far more limited than that of WinForms.

    • There's greater support in the 3rd-party control space for WinForms. (That's changing, but for now by advantage of time, WinForms has greater support in the community.)

    • The major drawback of WPF is that Mono doesn't really support it for cross-platform (e.g., it doesn't work on Linux and Mac). Originally, Xamarian/Novella said they weren't going to implement it due to the complexity of implementation. I haven't seen anything to the contrary. Not saying it isn't, but their recommendation is to write model classes and then do a OS-specific front end. Even with WPF being open sourced, it may be built on something that isn't easily ported.

  4. https://social.msdn.microsoft.com/Forums/en-US/e134134a-352f-435b-943a-eda7a2b14fc0/wpf-vs-windows-forms-2015?forum=wpf

  5. Depends upon your learning ability.

  6. Which parts of WPF should I definitely look into?

    • XAML: Learn about XAML and how it is used in WPF applications.

    • Layout: Learn about layout panels and how they are used to construct user interfaces.

    • Data binding: Learn how WPF data binding works and how it can be used.

    • Data templates and triggers: Learn how data templates and triggers work and how they can be used.

    • Styles: Learn about how UIs can be styled in WPF.

For more information refer below mentioned URL

Windows Form Vs WPF Windows

1
  • 4
    This is my two cents. I'm currently developing a GPS based real-time monitoring tool (vehicles etc). WPF is fantastic on graphics, re-draw, scaling, rotation, etc, but the learning curve is most certainly there, but not impossible. The question is whether your project is very GUI based or just transnational. You can stay with WinForms for transactional if you already have ample experience in that. If you're going on a high with graphical stuff WPF can allow you to separate better between the design (for the designers) and the backend (for the transactors). The learning curve is there though. Sep 7, 2019 at 18:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.