Is WPF ready for prime time?

Is WPF ready for prime time?

Old forum URL: forums.lhotka.net/forums/t/7234.aspx


MadGerbil posted on Monday, July 06, 2009

I'm thinking about doing my next project using WPF. I'm not worried about the learning curve, I just want to make sure that WPF is going to support everything a Windows Form Application supports.

I'm worried that if I adopt it early (this year) that I'll end up using a bunch of hacks to get it to work properly. If I wait a year or two it will "mature" and more features will be supported.

In short, is WPF ready for prime time or should a person wait for .NET 4.0?

RockfordLhotka replied on Monday, July 06, 2009

In my view, if you are going to discount the learning curve (which you shouldn't do lightly) and the lack of a designer, then WPF is ready for primetime. The only caveat is that you must be open to using third party controls, but you really need that in Windows Forms too in my experience.

The thing to remember is that WPF isn't Windows Forms. Your approach to building the UI will be different, and so your coding approach will be different. The thought model you need to use to succeed is different. This is why I say you shouldn't lightly discount the learning curve.

On the upside, after you learn how to use WPF, and after you build some level of UI framework or structure (much like you do in Windows Forms I'm sure), you'll probably find WPF to be far more productive than Windows Forms.

The data binding model is far superior. The overall layout and the way controls interact is far superior. The level of control you have is superior. But they are all different too, and everyone I've seen (including me) wastes a lot of time up front trying to use WinForms techniques only to discover that they solve a problem that is different from the actual problem you are facing...

Other than one demo for a talk a couple months ago, I haven't done any Windows Forms for over 2 years. And I have really enjoyed my time with WPF and Silverlight. I wasn't missing WinForms at all :)

But I must say that I'd totally forgotten how insanely productive you can be when you have a real designer tool. Building the Windows Forms demo from scratch was ridiculously simple, where it is never simple to build a WPF app from scratch.

That's probably the big thing. After you've build a UI framework - which I think you need to do for Windows Forms or WPF - then WPF is much better. But if you just fire up Visual Studio and start building forms without any overarching framework/structure, then WPF totally sucks in comparison to Windows Forms.

And that's where (hopefully) Visual Studio 2010 will help, by providing a real designer for WPF.

MadGerbil replied on Tuesday, July 07, 2009

I anxiously await your book entitled "WPF FRAMEWORK" =P

RockfordLhotka replied on Tuesday, July 07, 2009

You'll be waiting for a long while - I have little interest in writing a UI
framework :)

Rocky

lukky replied on Tuesday, July 07, 2009

Rocky,

You mention having to build a UI Framework in order to fully use WPF. Are you referring to something such as CAB/SCSF in the Winforms world ?

If not, could you provide some links ?

Thanks

RockfordLhotka replied on Tuesday, July 07, 2009

I mentioned “UI framework” as a requirement, and that has caused discussion – good!! :)

 

I’ve never thought you could build a real app (web, windows, etc) without putting some effort into designing and building a “UI framework” for the app.

 

This might mean something as complex and powerful as CAB or Prism. Or it might mean defining 3-4 interfaces and a unified shell that interacts with user controls that implement those interfaces.

 

In other words, I’m not saying you need “the framework to rule them all”, but you do need some structure.

 

This was true for Windows Forms, and is true for WPF. It was true for Web Forms as well imo. I’m not so sure it is true for ASP.NET MVC, because MVC actually is such a framework. But it is true for Silverlight, and is arguably more important there.

 

So sure, if you need the power of something like Prism, and can deal with the complexity, then you should look at that – though only if you actually want/need composite UI concepts.

 

Or if you want a single-document concept with attachable notes and clear navigation, you should hire Billy Hollis to deliver his training, because that’s the kind of framework he built for his last client – and it is really smooth – but is not a “framework” in the sense of being independent from the app they built.

 

And I rather favor that latter approach. Instead of finding or creating the “framework to rule them all”, and dealing with the complexity that invariably comes with that sort of framework, I’d rather take a minimalist approach and create the bare minimum necessary to support the specific UI requirements of my app or organization.

 

If you want an MDI style app, create the shell and interface support for MDI and be done with it. If you want an Outlook style app, create the shell and interface support for that and be done with it.

 

This stuff isn’t usually that hard if your scope is limited to the needs of your app, or your organization. Where it gets hard and complex is when you want a general purpose framework that supports numerous UI styles. Or if you really do have complex UI requirements like a true composite layout, where Prism comes into play.

 

Look at Chapter 19 in Expert 2008 Business Objects for example. In that chapter (and in PTWpf) I create a mini-framework for WPF. Just a base class for user controls and a shell form that knows how to interact with those controls in a consistent manner. Probably not quite enough for a real application, but not that far off either. And I designed/created that functionality in less than a day’s work. Given some decent UI requirements (in the broad sense around navigation, etc) and a couple weeks you should be able to create nearly any UI framework you’d need (assume existing expertise in WPF).

 

To be clear though, I expect to spend that same time at the start of a Windows Forms project too – because I want the same kind of “framework” support to get consistent navigation and UI interaction across a WinForms application as well.

 

Rocky

 

PitDog replied on Tuesday, July 07, 2009

I am currently using WPF CSLA 3.6 and the CAL(Composite Application Guidance) and so far so good 1 year in.

In my opinion building a framework for your UI is essential. You need to manage commanding, databinding, styles, datatemplate and a host of other things. Without some form of framework you will be chasing your tail. I know because we tried it that way first. I learned very quickly that WPF != WinForms.

The databinding in WPF is a major shift in how we do things. The commanding support as well as how routed events and commands work or in my opinion mind blowing. These complexities are why the MVVM/Presentation Model patterns have become so popular.

I have found the Composite Application Guidance a very good starting point. Even if you don't use what they give you the ideas and go along way to point out the differences in WPF application dev and good ol WinForms.

It is a steep learning curve but it is well worth it. I dont ever want to go back :-)

MadGerbil replied on Tuesday, July 21, 2009

I've spent the last week reading on and fiddlin' with WPF.

I love it already.

JoeFallon1 replied on Tuesday, July 07, 2009

Rocky - you just scared the bejeesus out of me about moving to WPF. I can't afford that steep a learning curve without a resource from you like a book titled: "How to build WPF apps using my UI framework architecture".  So when are you going to start writing it? <g>

Joe

 

matt tag replied on Tuesday, July 07, 2009

Literally, as I'm reading this, I'm installing Wpf third party controls (Syncfusion) to review for my first Wpf desktop app. 

Last week, I wrote a "hello world" Wpf app (along with a combobox bound to a CSLA collection, and a theme), and I'm ready to roll.  All I need is a grid, a docking UI (tabbed MDI is my current UI du jour), and some other misc controls.

I'm no designer - I'm not looking to custom create control "looks" from scratch.  But I do create nice-looking, well-behaved user interfaces given a decent toolset.  I want to continue doing this, but using Microsoft's latest technology.

Anyone with any links to resources about how to "not try and solve problems the Winforms way", as Rocky suggests, sound like they would be very helpful.

triplea replied on Tuesday, July 07, 2009

I think the book a lot of people (like me) are looking for shoud be titled: "WPF for Business Developers" or something along these lines.
The problem is that a lot of books (I have looked at 3-4 in the past) do not focus on the real issues people in this forum are interested in. 1-2 introductory chapters and then on to 3D graphics etc. I am sure there are some decent books out there, its just finding them.
But because all CSLA users face similar sort of challenges there may be a small market for a book that addresses such more relevant issues such as databinding, best practices etc. Maybe not a whole book but a couple of chapters or even a video.
This could then serve as a starting point to look at more complex UI frameworks but would ease the learning curve.

rfcdejong replied on Tuesday, July 07, 2009

In winforms we made a CRM project with SCSF formely known as CAB. We made the mistake of not making an own abstraction layer and started programming right away. I'm glad i got the time to write an "framework" using CSLA in the business and Prism in the frontend. Thru the frontend framework took the most of work and splitting up lots of functionality into an core framework and an application framework for each application we make, there are several. It's just adjusting the prism framework with abstraction layers and forcing the programmer into an direction and it only works against CSLA. Having a shell application with regions, modules, controllers, presenters and views with optional new regions. Loosely coupled is exactly what we need for our applications, we aren't using the viewmodel pattern but just having the "controller" as class around an business object. Each controller works with a business object. ReadOnlyController, BusinessController, ListController, etc

but.. not using the CslaDataProvider

And yes, WPF is far better as winforms (ready for prime time!). We first thought that performance would be an issue, but since WPF uses ActiveX on a grafics card it even is faster then Winforms on a desktop with onboard vga.

RockfordLhotka replied on Tuesday, July 07, 2009

The book you want (and that I want!) is Billy Hollis's book. Unfortunately
he decided to hold off on publishing it until WPF 4.0, so we're all stuck
waiting for it in the meantime...

Rocky

-----Original Message-----
From: triplea [mailto:cslanet@lhotka.net]
Sent: Tuesday, July 07, 2009 2:38 PM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] Is WPF ready for prime time?

I think the book a lot of people (like me) are looking for shoud be titled:
"WPF for Business Developers" or something along these lines.
The problem is that a lot of books (I have looked at 3-4 in the past) do not
focus on the real issues people in this forum are interested in. 1-2
introductory chapters and then on to 3D graphics etc. I am sure there are
some decent books out there, its just finding them.
But because all CSLA users face similar sort of challenges there may be a
small market for a book that addresses such more relevant issues such as
databinding, best practices etc. Maybe not a whole book but a couple of
chapters or even a video.
This could then serve as a starting point to look at more complex UI
frameworks but would ease the learning curve.

JonM replied on Tuesday, July 21, 2009

Our company is in the process of creating its first WPF app. Actually this app only uses a few CSLA classes but most of it is controlled by a set of state machines (because the logic is fairly complicated). Here is my take. You really need to read through a good WPF book first like the WPF Unleashed book. Also grid and listview performance is pretty bad if you need them to hold thousands of items compared to the winforms versions. The real value of WPF is being able to do crazy stuff that just is not feasible to do in winforms. We think WPF will be a good fit because our application uses a touch screen.

Copyright (c) Marimer LLC