Windows Forms vs. WPF

C#.NetWpfFormsXaml

C# Problem Overview


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?

C# Solutions


Solution 1 - C#

  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.

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

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

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

  2. Depends upon your learning ability.

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRon van AsseldonkView Question on Stackoverflow
Solution 1 - C#Litisqe KumarView Answer on Stackoverflow