Sorry this got so long … hopefully it is helpful! One thing I would mention is that these are the concepts/things that tripped me up, I’m not sure if I would use it as an itemized list of what to study if you are just starting out. I would dive in on some books, read through a lot of blogs (Josh Smith, Dr. WPF), and just in general, dive in and try things out in little projects.
Core Concepts
-
The Logical and Visual Trees (links: 1)
Understanding the different trees in WPF. In particular, understanding the logical tree versus the visual tree and how elements in the logical tree gets expanded into the visual tree by way of data templates, control templates, etc.
-
The Dependency Property System (links: 1, 2)
Understanding the whole dependency property system in WPF is much bigger than it first looks. Sure, it is easy to create a quick dependency property and then use it to empower other WPF concepts like data binding and animation, but then it begins.
There are normal dependency properties and then there are attached dependency properties. There are a bunch of different ways to register them all and a bunch of different metadata options that you can set.
Understanding why it is called a dependency property, for that matter, took me some time. That is, understanding that the value of property comes from many different sources (the property depends on these value providers) and that there is an order of precedence/algorithm for how the final property value at any given time gets set.
-
Routed Events (links: 1, 2)
Understanding how they can be bubbling, routing, or direct. Understanding that you can also have attached routed events (versus just attaching an event handler to an event that has routed up the visual tree).
Tips
Chapter 3 in Adam Nathan’s WPF Unleashed is an awesome chapter that covers these important new concepts and one that you should read, work on a project, and then read again.
Dr. WPF’s snippets are a great way to learn about dependency properties, routed events, and commands.
Graphical Concepts (links: 1)
-
Resolution Independence (links: 1, 2)
WPF brings all the benefits of resoultion independence (you specify everything with device indepenent pixels) but this also brings some headaches that you need to solve. Most notably, is getting things to look sharp when you want them to by taking advantage of pixel snapping, by setting guidelines, etc.
-
Retained Mode vs. Immediate Mode
WPF has a retained mode drawing subsystem, meaning that it keeps track of the drawing instructions and caches them for later use. This can be a performance problem if you are trying to build something that has a lot of visuals that are all updating at once.
-
Controls, Elements, Visuals (links: 1)
Understanding what each thing in the WPF hierarchy does for you and understanding the weight it brings in performance. In particular, do you use a Control that you can retemplate, restyle, and more … or do you need something ultra-light (like programing against the Visual layer) so that you can drive it hard and fast.
Tips
Chris Sells and Ian Griffiths have a great appendix at the back of their Programming WPF book that talks about the different types in the WPF API, where they fit in the hierarchy, and what value they bring.
WPF Patterns
-
Model-View-ViewModel (MVVM) Pattern (links: 1)
The MVVM pattern has already been mentioned as helping one to start doing things the WPF way. I can’t agree more. Instead of filling controls with data, you start transforming data into visuals (through data templates).
-
Attached Property Behavior Pattern (links: 1, 2, 3)
WPF is extensible like no other API. Utilizing attached properties, you can build in additional behavior in a very elegant manner and where you thought you might have been stuck.
WPF != Windows Forms
I know someone already mentioned this but I want to agree emphatically. There are so many new and different concepts, you really do have to unlearn quite a few things and approach solving problems from a completely different angle. As an example, Windows Forms is an immediate mode drawing subsystem while WPF is a retained mode one (above).
The Many, Many Ways To Do Things in WPF
This is a funny thing to bring up, but because there is so many ways to do something in WPF, it is almost paralyzing. Which way is the right way to do things? Is it this? Is it that? I have had to get over a fear of doing it the wrong way, to just jump in, and learn from my mistakes.