Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the main benefits of getting into WPF?

Tags:

wpf

Recently I started using WCF, and I was very impressed, so much so , that I am wondering about getting more into WPF, but my initial experiences with XAML were not that great, about 1 year ago.

Have things improved, is the delivery truly browser independent (can run on browsers other than IE).

Is development productivity increased, better code/ui seperation? Does it require learning silverlight?

If you've had real experience with WPF, please state the pro's and cons.

like image 241
JL. Avatar asked Oct 07 '09 20:10

JL.


2 Answers

First:

WPF is 100% browser independent, because WPF doesn't run in the browser.

XBAP (now deprecated) and Silverlight run in the browser, but both are subsets of WPF.

Second:

The major benefit of WPF is the hierarchical nature of the GUI structures you can create. If you've ever done ASP.NET programming, WPF is a more natural move than WinForms.

Databinding in WPF is different, but better, IMO.

Bottom line: XAML and it's intricacies are a big learning curve, and WPF and XAML go very much hand in hand. But once you understand the basics and can start constructing basic GUIs with it, you'll never want to use WinForms again.

Regarding Pros and Cons, I'd say the only real con to WPF is the large learning curve. It can do everything WinForms can do from a .NET perspective, and is easier to use (once you understand it) than WinForms. The only place it might be "lacking" is in direct GDI+ manipulation, but you'll probably want to avoid that wherever possible. If it becomes necessary in a WPF project, just create a WinForms control and host it in WPF. Not the most elegant solution, but it can get the job done.

like image 134
Randolpho Avatar answered Oct 15 '22 02:10

Randolpho


If you're doing in-browser development, you probably want to use Silverlight. It is similar to WPF, but browser independent, and gaining a lot of traction in terms of usage, as well as a lot of attention from Microsoft. (For example, the new RIA services is pretty nice, for business apps.)

Both WPF and Silverlight provide many of the same benefits when compared to older technologies for UI development, though, such as Windows Forms.

  • Databinding in WPF and Silverlight is very powerful, and very flexible. This can both speed up development and provide a level of safety that was difficult to create before.
  • UI development, though different, is much more flexible. The separation of presentation from behavior in WPF and Silverlight makes it very easy to create very customized UI code, very quickly.
  • The new commanding interface, in conjunction with DataTemplates, allows for much easier development in a manner that's very flexible, testable, and maintainble (by using the MVVM pattern).

All of these lead to a much nicer long term development, once you get over the learning curve, in my opinion.

like image 23
Reed Copsey Avatar answered Oct 15 '22 02:10

Reed Copsey