tags:

views:

406

answers:

6

I'm considering switching from MFC to WPF.

My first concern is that there are too many users who don't have .NET with WPF installed yet. Can anybody point to a source containing the WPF penetration numbers?

My second concern is speed.

Any other considerations?

+7  A: 

What kind of application are you developing? If it's a wide-distribution desktop app that you want your grandmother to install, your concern about .NET 3.0/3.5 adoption is valid. So far from what I've seen, performance is less of a concern.

Dave Swersky
Note that Silverlight is much younger than WPF and is not preinstalled on Vista, so its penetration numbers are likely to be much lower than WPF. If you're shipping a CD you can include the latest NET Framework and have it install automatically. If you're downloading you can easily integrate the Windows Update process into your installation procedure. In either case, your grandmother doesn't need to take any extra steps because you used WPF.
Ray Burns
@Ray How do you go about integrating the Windows Update process into your installation procedure?
Ra
@Ray True- the riastats site is not as good an indication as I had thought.
Dave Swersky
@Ra- The Setup project you can create with VS 2008 includes "Prerequisites". These include things like .NET and SQL Express. Add a prerequisite for the .NET version you need (3.5) and have it download from the default Windows Update location.
Dave Swersky
+9  A: 

I've been banging away at WPF for a while now, it is brilliant but still has (occasional) holes you've to plug yourself. However all indications are .net 4.0 will be a significant step forward.

I would say start now. The WPF learning curve is REALLY steep, it'll be a while before you'll be releasing software to users, believe me. Also do yourself a favour and get the WPF Unleashed book. It's superior.

Speed isn't a consideration. The power WPF gives is well worth any drawbacks with speed, which - coming from Windows Forms - I haven't noticed to be honest.

Hope this helps.

Binary Worrier
+6  A: 

WPF penetration

First of all, Vista and Windows 7 both have WPF preinstalled, which accounts for 35% of the market automatically. Windows XP has had it has had NET Framework 3.0 as an option in Windows Update for over three years, and many applications ship with it, so it is likely to also be installed on a high percentage of XP machines. StatOwl indicates that about 80% of NET Framework installations are version 3 or above.

If you're shipping on CD it is no big deal to include the latest NET Framework on the CD and have it install automatically. If users are downloading your app, it can contact Microsoft's web sever to download and install the latest NET Framework. Online ClickOnce deployment also has this capability if you want people to be able to start their application directly from the web browser without installing it.

So the bottom line is, you probably don't need to worry about whether people will have WPF installed on their machines or not unless your target market consists primarily of dial up customers on Windows XP who don't run much third-party software (ie. they just run Windows and your app).

Speed

Not an issue. I have a 200MHz Pentium Pro with 384MB RAM from 1998 that I test my software on, and my WPF applications have comparable performance with equivalent MFC applications. If your WPF application uses lots of fancy graphics and animation it will run slowly on ancient CPUs and graphics cards, but so would an ordinary MFC application with the same features.

Ray Burns
+3  A: 

Don't even bother trying to use WPF if you are sticking with Visual Studio 2008 for the next year or two. The experience will be way too painful. I'm talking about "my IDE crashed again" type of pain.

If you are going to use VS 2010 in the near future, then WPF is a blast. Download the beta, a couple of themes off CodePlex, are start playing. Once you get past the (freaking huge) learning curve I think you will find it to be quite enjoyable.

Jonathan Allen
+3  A: 

IMHO, you should wait for VS10 and WPF 4.0 to make the actual migration, they will close some very annoying gaps in the product.

Meanwhile, you can try it out. In terms of coding/readability -- it's going to be WAAAY better than with MFC =)

As for the performance and platform -- it shouldn't be a problem unless you have any very special circumstances (like if you can't require users to install .NET).

Also see this related question on switching to WPF from WinForms.

HTH.

Yacoder
A: 

If you are thinking about a larger, modular, appliation I recommend checking out Prism. It's a bit of a beast itself, but you should be able to tackle it after coming to grips with C#, Dependency Properties and XAML. Plus, learning Prism gave me a much better understanding of WPF/Silverlight, at least from the development/binding side.

Mike Taulty posted an excellent 10 part video series on Prism. It's a great way to get your head around the platform.

I'd also recommend the pages linked to from the Getting Started page on codeplex. After all that, you're probably ready to tackle the Reference Implementation which comes with the download.

A previous answer of mine might also help clear up any remaining confusion around Controllers/Presenters in the framework that you might have (I did).

Richard Szalay