WPF for Developers

This page has supporting material for my presentation on WPF for Developers. It is not meant to be an exhaustive reference to every section of the presentation or every aspect of WPF; it is a list of important resources from the presentation and other useful WPF resources.

You can download the presentation and demo code here

Links

MSDN XAML Overview Overview of XAML on MSDN.
WPF Business Application Series This is the first in a series of CodeProject articles by Karl Shifflet on writing business applications using WPF. It is a work in progress and honestly does not show the greatest organization (to me at least), but it is covering a number of topics relevant to business development in WPF. It is also one of the few online resources that has source in VB.NET.
Property Value Inheritance This MSDN page talks about property value inheritance in dependency properties.
Validation in WPF CodeProject article on validation in WPF, including an implementation of an ErrorProvider component to take advantage of the IDataErrorInfo interface using the 3.0 framework.
Data Validation in 3.5 Blog post about data validation in the 3.5 framework.
INotifyPropertyChanged Implementation Blog post by Josh Smith describing his implementation of INotifypropertyChanged, which inspired what is in my demo application.
Using MVC to Unit Test WPF Applications CodeProject article by Josh Smith on using MVC (Model View Controller) with WPF.
Model-View-ViewModel Blog post from Bryant Likes with links to various posts on Model-View-ViewModel in WPF by Dan Crevier and John Gossman
Understanding the Visual Tree and Logical Tree in WPF Another CodeProject article by Josh Smith to describe the role of logical and visual trees in WPF.
Writing a Custom Markup Extension Brief blog post on creating custom markup extensions.
WPF Add-Ins Overview MSDN article on the new capability in the 3.5 framework to create WPF addins by leveraging the System.AddIn namespace.
What's New in .NET Framework 3.5 Service Pack 1 Summary of the new WPF features in the .NET Framework 3.5 Service Pack 1.

Blogs

Josh Smith About eight out of ten times when I'm looking for information on WPF, Josh Smith has written either a blog post or CodeProject article about it. If you're interested in WPF, I highly recommend that you follow his blog.
Karl Shifflet There's a lot of WPF content here. Also all of his samples appear to be in VB.NET.
Me Guess I should plug my own blog. I post on quite a variety of topics including WPF.

Resources

Mole Mole is not necessarily specific to WPF, but it's very cool tool for exploring WPF. It is a debugger visualizer which will help you view the visual and logical tree of a WPF window. Using it is as easy as dropping a .DLL in the right folder then selecting it in Visual Studio. The documentation will help you get started.

Books

Pro WPF in C# 2008: Windows Presentation Foundation with .NET 3.5, Second Edition (Books for Professionals by Professionals)

If you want to read only one book on WPF, I would recommend this as the one book you purchase. I own the first edition of the book, Pro WPF: Windows Presentation Foundation in .NET 3.0 and my evaluation is based on that version. The first edition has broad WPF coverage with an extensive index. I liked the writing style and generally found the book easy to read (when it wasn't easy to read, it was because of content, not writing style.)

This is the first book I read on WPF, and I think it got me off to a good start.   I got a solid understanding of the underpinnings of WPF by reading the first several chapters.  I started reading this book sequentially, but finally skipped a couple chapters on graphics.  I still ended up reading it mostly from beginning to end.   There were times that I wanted to "skip ahead", but it does seem to be structured so that each chapter builds on the previous (this might also be because this is the first WPF book I read.) 

I found it valuable that in the early part of the book, notes often refer to better ways to handle things that will be discussed later.  One example is where he is setting the MinWidth and MaxWidth values on several buttons in chapter 4, but has a note referencing styles which are described in chapter 12.  So many times, authors describe primitive ways to do something without referencing the better way.  And then we copy the code and do it the hard way.

Pro WPF with VB 2008: Windows Presentation Foundation with .NET 3.5 (Pro)

VB.NET version of Pro WPF.
Windows Presentation Foundation Unleashed (WPF) (Unleashed)

This is the second WPF book I read after, Pro WPF.  It's shorter than Pro WPF (620 pages versus 931 pages) and it does not have the extensive index of Pro WPF.  But I find it is the WPF book I refer to for  examples.  And it's the book with several bookmarks sticking out of it, which means it's the one I've been using.  Since it was not the first WPF book I read, on my first reading, I mostly skimmed the content, looking for new stuff.  Since then, I've returned to read several chapters as review.

One noticeable feature of this book is that it is printed in full color, which in case you somehow manage to miss it, is proclaimed in large type on the cover.  And for some reason, the fact that "Code samples appear as the do in Visual Studio!" is also displayed on the cover.  Of course, the code samples in the book do not match my Visual Studio, since I'm not using the default colors.  The color is helpful in some circumstances, such as when displaying color gradients.   And I like the color in the code.  But when I first opened the book, I was actually put off by the color choices, particularly for the Tip and Warning sections, which make things a little too busy in combination with everything else.

Color aside, there are some excellent illustrations that succinctly show important WPF concepts, such as Figure 5.1 on page 128 which visually describes the vertical and horizontal alignment, margin and padding properties.

I also enjoyed the Warning, Digging Deeper, and Tip sections that contain useful information that does not fit in the natural narrative (although I found myself searching for some of these because the content wasn't indexed).  I also found the order of material presented in this book to be better than Pro WPF, which seemed somewhat out of order.  As compared to Pro WPF, this is probably the better introductory book and may not be as well suited for in depth reference.  At my current level of experience with WPF, it's the book I open up if I want a quick reminder on how a simple things work in WPF.

Applications = Code + Markup: A Guide to the Microsoft Windows Presentation Foundation (Pro - Developer)

This is a unique book. If you’re familiar with his previous books, this one will come as no surprise. Instead of starting with XAML, Petzold starts by describing how to create WPF application purely in code, and the first half of the book is devoted purely to code. The second half of the book introduces the markup language (i.e. XAML). I think this makes a good addition to the other books and I have found things in this book not in the others. It’s especially useful when you’re trying to figure out how to do something in code.