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?
The difficulty with learning WPF is not so much the API as the model. It's a very different mental model than you'd use with something like Windows Forms. Rather than writing methods that imperatively populate a UI element, you generally data bind to properties on an object.
Yes. WPF is probably still the best technology out there for building Desktop Applications. It is extremely powerful for creating any PC business based application and there are businesses that still use applications that were written in this technology.
It was in 2006 that Windows Presentation Foundation (WPF) was released with . NET framework 3.0. Over the years it got improved and it is still now in the market in 2021.
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!
Although already listed above, I wanted to reiterate one point.
Kaxaml is bar none, the best loose xaml editor out there. It has a snippet library, IntelliSense, split view, a xaml scrubber (pretty print), and more.
I only wish we could hook up some assemblies (that you could reference from the xaml) ...
Robby Ingebretsen, you rock.
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
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.
I would also highly recommend using Blend together with VS 2008. Blend is great for creating animations.
The Blend 2.5 Preview can be freely downloaded.
I like the Designer WPF Blog, which has some good tutorials on how to do WPF stuff in Blend.
I would humbly also suggest taking a look at my blog, 2,000 Things You Should Know About WPF, where I post a single piece of information on WPF each day. The blog starts with first principles and gradually works into more advanced topics, so it's a good place to start, as a beginner.
Mastering WPF (and silverlight, and basically any vector based XAML .net rich UI framework) requires more than understanding the new development concepts (and there are many). Its not enough to fully understand dependency properties, attached properties, templates, data binding, styles, MVVM, the layout mechanism, visual states and parts, effects, routed events... To really know your way around, you need to understand some basic concepts in graphics (such as vector graphics, raster graphics, rendering, layered graphics techniques, animation, pixel shaders, gradients, geometries, paths, brushes, transformation matrices, etc). In addition to that, you need to learn and understand M-V-VM which is not just a new design pattern - its a whole new programming paradigm. So there is a lot to learn... and the problem is that no matter which starting point you pick, you always feel that something is missing.
I tried several books as a starting point and many of them got me quite confused. Then I found "Illustrated WPF" by Daniel M. Solis and this one did the trick for me. He explains concepts from the world of graphics in a way that is clear to developers, and then teaches all the new concepts of XAML based UI while lightly touching each topic and diving into specific topics through a demo. Simply by following the tutorials, you find that you have learned a lot, and more importantly, removed the fear factor.
Once you master that, you can move on to "WPF Unleashed" by Adam Nathan and dive deeper. This one gives you a much more In-Depth view of the concepts that are unique to WPF, which I believe you have a much better chance of understanding once you have seen each feature at least once. They somehow all complete eachother and only make sense together.
You will still have tons to learn after that, but at this point you can develop rich applications and learn new topics as you go...
Enjoy :-)
Visual Studio 2008 (there's a free Express version). That's all the tools you need.
Then try some How-to videos. Here's a good start: http://windowsclient.net/learn/videos_wpf.aspx
Microsoft actually has a decent introduction on MSDN: http://msdn.microsoft.com/en-us/library/aa970268.aspx
Teach Yourself WPF in 24 Hours http://ecx.images-amazon.com/images/I/41ZM9hbeGoL._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA240_SH20_OU01_.jpg
http://Teach Yourself WPF in 24 Hours
One resource I found that really helped me was from jfo's coding: http://blogs.msdn.com/jfoscoding/articles/765135.aspx
The document is entitled "WPF for those who know WinForms", which is exactly the position I was in last year!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With