Author: Adam Nathan
Publisher: Sams, 2013
Audience: Anyone wanting to understand WPF
Reviewer: Mike James
If you work with WPF, which now seems to have an assured future,this is a book you need to know about.
This is the latest edition of a well known and well regarded volume on WPF and covering WPF 4.5 makes it effectively a 3rd edition.
The book is still organized into six parts and only the final part is modified with the addition of a new chapter on Toast notifications and one on XAML readers and writers. It also claims to be applicable to both desktop and Windows store apps i.e. WinRT apps. It is but don't expect much explicit "this is how you make a Windows Store app" discussion. The point is that XAML is a layout language that you can use for both desktop and store apps and this is the spirit that the book means it in. It does tell you when some feature or other isn't available in the case of a Desktop app.
Part I is an overview of WPF and introduction to XAML. Personally I don't think that the focus on XAML is the right place to start. It is usually much easier to understand how WPF works and what is going on by looking at the code that implements it or the code that uses the facility.
If you do things in this way then XAML is then just a simple transformation of the active object creation and initialisation into a set of declarations. However, the coverage of XAML goes well beyond the usual surface level stuff and includes information about compiled XAML, how the namespaces work, its relationship with the various object trees and reading and writing XAML.
The final chapter of the first part deals with WPF fundamentals - the class hierarchy, logical and visual trees and Dependency properties.
This takes us into Part II which is about building a WPF application. Here we encounter the basics of building a UI - the layout mechanism, layout panels, events, deployment and using Windows desktop features. It covers event in detail including touch events and stylus events.
Part III deals with controls and it is a categorised exploration of the standard controls - content controls, item controls and images, text and other controls. This is an interesting and informative catalog of what you can do to build a UI using mostly XAML. It is probably the part of the book that you will return to most often as you work with WPF. It now includes coverage of the new Ribbon control.
Part IV has the title "Features for Professional Developers" and I'm not at all sure why the features covered are "professional" - resources, data binding, styles templates, skins and themes. There is also an argument that data binding is more fundamental than the other features and probably should be split out into its own chapter or part. It probably doesn't matter because the chapters are fairly self contained.
Part V is perhaps the most exciting for the average programmer - 2D graphics, 3D graphics, animation, audio, video and speech. Unfortunately this is the weakest part of the book simply because it needs to be a book in its own right. There is so much more to using even 2D graphics in WPF, let alone 3D graphics. As far as this section goes it's great - but you will need more information after you have got started.
The final part is a collection of topics that didn't fit elsewhere in the book. Interoperability with WPF technologies is mainly about mixing Windows forms controls and ActiveX with WPF and vice versa, but it also mentions using DirectX. The next two chapters describe how to build User and Custom Controls and Custom Layout panels. The final two chapters are all new - on toast notification and on XAML readers and writers.
Again, excellent introductions that will get you started but they demand a separate book to provide the depth needed.
The book is printed in full color and this is used to good effect throughout - it not only makes it look good but it is easier to read and understand. The author's style is very readable and clear with plenty of asides that fill in missing detail without being disruptive of the overall flow of the book.
Whatever minor criticism have been listed above this is a really good book on WPF the only real problem is that it can't possibly cover the whole subject in sufficient depth.
It isn't for the complete beginner and it isn't a "how-to" or cookbook - it is about explaining the ideas rather than providing real world examples.
If you work with WPF you really need a copy of this book.