Чем wpf отличается от windows forms
Перейти к содержимому

Чем wpf отличается от windows forms

  • автор:

WPF or Windows Forms

I’ve been playing around with C# console applications for about a year and I want to move on to creating GUI applications. I have never done any GUI development besides basic Java applications, but I want to continue using C#. Should I start learning Windows Forms or jump straight to WPF? Is there a huge difference? Does WPF build on top of Windows Forms or are they totally different?

asked Apr 21, 2010 at 17:29
2,870 4 4 gold badges 23 23 silver badges 20 20 bronze badges
I found this site very intersting: educba.com/winforms-vs-wpf
Feb 11, 2020 at 18:43

4 Answers 4

If you’re just starting out, jump straight into WPF.

It will allow you to get starting making rich interfaces using mark-up to define your interface without teaching you the possible bad habits (for WPF) that you’d learn from Windows Forms.

31.2k 22 22 gold badges 109 109 silver badges 132 132 bronze badges
answered Apr 21, 2010 at 17:32
Justin Niessner Justin Niessner
244k 40 40 gold badges 411 411 silver badges 540 540 bronze badges

+1 I absolutely agree. WPF is far more flexible than Windows Forms and it is the long-term in GUI development. It’s very close to HTML in how you use an XML-based layout. The best argument for Windows Forms right now is if you have a dev team with major experience using it. WPF is the future, and it already is leaps and bounds ahead of Windows Forms.

Apr 21, 2010 at 17:35

+1 but, WPF is only usable from .NET 4.0+ because of the font issues in previous versions, so keep that in mind for application deployment.

Apr 21, 2010 at 17:38

@Fauxide WPF is usable in .NET 3.5. There have been plenty of useful apps built. font issues aren’t a show stopper for everybody.

Apr 21, 2010 at 17:39

+1 — Done WinForms for years, now in WPF. Never to look back 😉 WPF is a lot nicer, a lot faster. Was using only 3rd party controls in winforms for years — now I use them, but not ONLY (i.e. the standard controls are usable, 3r party is not a replacement but new stuff). Especially with .net 4.0 — wpf rocks. Oh, and I do high performance data visualization (a.k.a. financial instrument trading application).

Apr 21, 2010 at 17:44

+1 WPF has a bit of steep learning curve, but once you’ve learnt it it’s fantastically powerful. Make sure you start with the MVVM pattern though, it just makes sense.

Apr 21, 2010 at 17:45

These two are totally different technologies. They do offer some interoperability layers to both directions, but other than that have nothing in common. Windows Forms is more or less a lightweight wrapper on top of Win32/MFC, which means its extensibility in .NET is not that good in all cases. WPF is a new UI framework implemented from scratch. WPF is also much more flexible when it comes to customizing the existing types.

However, at least from my experience, Windows Forms seems to be the more commonly-used desktop UI framework in the industry. Windows Forms can’t be used with web development though while WPF offers Silverlight and XBAP applications.

If you have done any UI development before, I’d dare say Windows Forms is easier to learn as it follows more traditional programming paradigms. The programming model of WPF is quite different to this. While WPF can be used in the same way as Windows Forms, most of its benefits are not achieved until you embrace the data binding and encapsulation WPF provides.

Despite stating some points in favor of Windows Forms choosing WPF over Windows Forms would be a no-brainer for me if all you want to do is learn a UI framework. It’s superior to Windows Forms in all aspects. I just wish the software industry in general would adapt it on a larger scale! (Though not like anyone writes desktop applications any more since we got the web.)

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *