Pro WPF 4.5 in C#

Windows Presentation Foundation in .NET 4.5

This book shows you how Windows Presentation Foundation really works. It provides you with the no-nonsense, practical advice that you need in order to build high-quality WPF applications quickly and easily.

Related Titles

Microsoft's Windows Presentation Foundation (WPF) provides you with a development framework for building high-quality user experiences for the Windows operating system. It blends together rich content from a wide range of sources and allows you unparalleled access to the processing power of your Windows computer.

Pro WPF 4.5 in C# provides a thorough, authoritative guide to how WPF really works. Packed with no-nonsense examples and practical advice you'll learn everything you need to know in order to use WPF in a professional setting. The book begins by building a firm foundation of elementary concepts, using your existing C# skills as a frame of reference, before moving on to discuss advanced concepts and demonstrate them in a hands-on way that emphasizes the time and effort savings that can be gained.

What youll learn

Understand the fundamentals of WPF programming from XAML to controls and data flow.

Develop realistic application scenarios to see navigation, localization and deployment in action.

Explore the advanced user interface controls that WPF provides.

Learn to manage documents from within WPF: Text layout, printing, and document packaging are all covered.

Use graphics and multimedia to add punch to your applications

Who this book is for

This book is designed for developers encountering WPF for the first time in their professional lives. A working knowledge of C# and the basic architecture of .NET is helpful to follow the examples easily, but all concepts will be explained from the ground up.

This is because the author fails to add a Name attribute to the two borders representing the FrontContent and BackContent. This causes the Control Template to throw an InvalidOperationException when ChangeVisualState is called due to BackContent not being in the Name Scope of the XAML page. The solution is add the name attribute like so:

The second parameter of BindingOperations.GetBinding & BindingOperations.GetBindingExpression methods should be a dependency property instead of a regular property, so the corresponding statements should read:

In the complete XAML markup example in the middle of the page, there is one missing XAML namespace mapping for the local namespace that's referenced in the command binding for the new command.

I believe something like below should be added to the Window element:

<Window ... xmlns:local="clr-namespace:Commands"...>...</Window>

On page
336:

This new pattern will match only URLs that contain three segments, the first of which must be Customers.

Should be:

This new pattern will match only URLs that contain three segments, the first of which must be public.

On page
559:

Stored procedure name in first sentence of second paragraph should be "GetProductByID" instead of ""GetProduct". A more significant problem is that this stored procedure in the database does not return "CategoryName" and so the "GetProduct" method fails.

On page
560:

Actual code for "GetProduct" method retrieves "CategoryID" and "CategoryName" as well and hence fails because "CategoryName" is not returned by the stored procedure.