When .NET first appeared it brought with it, among other things, Windows Forms: a library of classes for building Windows applications. Although it worked well enough, it was built on a foundation that was ten years old. We are now more than five years past that and Windows Presentation Foundation (WPF) finally brings a new model that contains totally new plumbing and many more powerful features.
Pro WPF in C# 2008: Windows Presentation Foundation With .NET 3.5, Second Edition is an in depth exploration of WPF for professional developers who know the .NET platform, the C# language (there is a separate Visual Basic Version of this book available as well), and the Visual Studio environment. It is 1040 pages in length and divided into 27 chapters.
The first two chapters bring an introduction to what Windows Graphics are, and the new direction that WPF has taken with DirectX and the new graphics engine. Then, you take a look at the WPF API, the evolution of WPF, and the Architecture of WPF. Next, you will learn about XAML; which is the eXtensible Application Markup Language (pronounced “zammel”), and how it works with WPF, its properties and events, and how to load and compile XAML.
Chapters 3 to 9 focus around the building blocks of your application. These include the layout, content, properties, classic controls, and the windows of your project. You will begin by seeing how an application is built, the layout process, the containers, and how they are used. Then you will work with properties and events. Next you will delve into the control class and the windows class and finally finish up with seeing how pages are put together and work with the navigation service.
Chapters 10 and 11 examine commands and resources. Commands are tasks that have been defined to connect to controls to eliminate the writing of repetitive event handling code to manage the state of your interface. Resources are effectively items that your applications need to run. They can be assembly resources such as an image or sound file, or they can be an object resource that is defined in code.
Chapters 12 to 15 cover design aspects of your application. First you will get into styles which are a collection of property values that can be applied to an element. Then you will start with simple 2D graphics that will show you how to draw basic shapes which can be assembled into more complex graphics. Next, you will extend those skills with new concepts such as modeling arcs and curves, as well as converting existing vector art into the XAML format. And finally you will work with control templates that will let you customize controls without having to build controls from scratch.
Chapters 16 to 18 work with the handling of data. You will work the essentials of WPF data binding; that is, how to pull information out of an object and display it in a window with little or no code. Then you will see how to convert it into the representation that you need and validate it. From there you will look at working with data templates to customize the way that the data is presented, data views to present the information, and then data providers to see how to pull the information with less code. Finally you will use lists, trees, toolbars, and menus to present data in a variety of ways.
The remainder of the book concentrates on other aspects of your application including documents, printing, rich media; this includes animation, sound, and 3D graphics, interoperability, multi-threading, and deployment. One of these demonstrates that printing in WPF is much more powerful than ever before. Things that you would have had to dug into the Win32 API or WMI, such as checking a print queue, is now fully supported using the new system Printing namespace. Also, now you can add animation and 3D to make your interfaces both dynamic as well as more modern.
Pro WPF in C# 2008 is a remarkably well written and well thought out book. It covers just about all aspects of WPF and is well suited for anyone who is looking to get into WPF. Keep in mind that any mention of other technologies, such as LINQ, are just in passing; there is a very hard focus on WPF. It is current with Visual Studio 2008 and .NET 3.5, and even if you owned the first edition, there may be enough changes to make it worth the upgrade so you would want to check it out.
While there is everything to like about Pro WPF in C# 2008, I especially like the flow throughout the book. For the complete WPF beginner, it will guide you from beginning to end. For the more experienced Windows Forms developer, it will let you cherry pick what you need and leave the rest for later. And for all, it will provide a good reference book for the future. If you don’t own Pro WPF in C# 2008 and want to get into Windows Presentation Foundation then I very highly recommend this book.