How to begin WPF development?
I've been using Winforms since .NET 1.1 and I want to start learning WPF.
I'm looking for some good resources for a beginner in WPF. What should I read, what tools do I need, and what are the best practices I should follow?
Please have a look at this StackOverflow post, which has a list of book recommendations.
In terms of best practices, get familiar with the M-V-VM pattern. It seems to have gained the most traction in WPF-land.
Check out this post for what tools you can use for WPF development.
The MSDN Forum is a great place for resources, as is the MSDN help files on WPF.
My personal recommendation is for you to forget everything you have learnt about WinForms. WPF is a totally different model, and once I finally dropped my "I did it this way in WinForms, but that way doesn't work in WPF" I had one of those "lightbulb" moments.
Hope this helps!
The learning curve is high, but there are a lot of really good resources out there. And, the MSDN documentation and SDK samples (as some have already mentioned) are really good.
One thing that will help you though, is just to acknowledge the learning curve up front, and to not get discouraged when it doesn't make sense. There really are a lot of concepts to 'grok' before you can do some even basic things.
The WPF books already mentioned are all valuable in their own way. My personal experience was that I got a copy of WPF Unleashed first and tried reading it to no avail. It wasn't until I picked up Charles Petzold's Application = Code + Markup and read through some of that ... before I could even begin to understand WPF Unleashed. However, my brain needs detail before concepts actually sink in ...
Tim Sneath has an excellent list of WPF bloggers that I have found valuable to get hooked into the WPF community: WPF Bloggers
A few blogs on my must read list:
- Rob Relyea
- Dr. WPF
- Josh Smith
- Robby Ingebretsen
- Kevin Moore
- Charles Petzold
- Pavan Podila
Another thing I would do is get Dr. WPF's snippet library (located here). This is an extremely good way to learn some of the basic plumbing type concepts like Dependency Properties, Routed Events, and Routed Commands.
Finally, I would get a copy of Blend (v2.5 is still in beta and free) and use that to generate xaml and then dive into that generated xaml to understand what you did in Blend, maps to the WPF API.
Hope this helps. Good luck.
1 Start understanding the XAML and control heirarchies - UI markup and the new terms and features around it. KaXaml is a great tool to learn XAML, It is free to download http://www.kaxaml.com/
2 Since you have already got a long .NET experience, go directly to the SDK Samples and start running in it and see what is happeing, play with XAML. http://msdn.microsoft.com/en-us/library/ms771449.aspx
3 If you are looking for Blog resources here is my best suggestion
- Josh Smith - http://joshsmithonwpf.wordpress.com/
- Dr. WPF - http://www.drwpf.com/blog/
But selecting a simple UI scenario which you already implemented or saw somewhere and try implementing it in WPF - That is probably the best approach to learn a new technology.
And please dont get afraid of MVVM , those things will come handy later once you got familiar with WPF platform and XAML.
Adam Nathan's - WPF Unleashed, book is very good.
I'd recommend the book Windows Presentation Foundation Unleashed by Adam Nathan
Then I'd recommend you write an application. Like every other dev environment, there are no perfect guidelines. You have to find the ones that make the most sense for your circumstance. The only way to do that is to just start coding.
As for tools, Visual Studio 2008 [Express] is your best bet. Or you might be able to limp along with XamlPad.