WPF 4.5 Unleashed

Adam Nathan  
Sams Publishing
Total pages
July 2013

Product detail

Product Price CHF Available  
WPF 4.5 Unleashed
66.30 approx. 7-9 days

Table of Contents

Introduction     1
Who Should Read This Book?      2
Software Requirements     3
Code Examples     3
How This Book Is Organized     4
Conventions Used in This Book     6

Part I: Background
Chapter 1: Why WPF?      7

A Look at the Past      8
Enter WPF     9
The Evolution of WPF     12
Summary     16
Chapter 2: XAML Demystified     17
XAML Defined     19
Elements and Attributes     20
Namespaces     22
Property Elements     25
Type Converters     26
Markup Extensions      28
Children of Object Elements     31
Mixing XAML with Procedural Code     36
XAML2009     44
XAML Keywords     49
Summary     52
Chapter 3: WPF Fundamentals     55
A Tour of the Class Hierarchy      55
Logical and Visual Trees     57
Dependency Properties      62
Summary     76

Part II: Building a WPF Application
Chapter 4: Sizing, Positioning, and Transforming Elements     77

Controlling Size     78
Controlling Position     83
Applying Transforms     86
Summary     95
Chapter 5: Layout with Panels     97
Canvas     98
StackPanel     100
WrapPanel     102
DockPanel     105
Grid     108
Primitive Panels     120
Handling Content Overflow     122
Putting It All Together: Creating a Visual Studio-Like Collapsible, Dockable, Resizable Pane     130
Summary     140
Chapter 6: Input Events: Keyboard, Mouse, Stylus, and Touch     141
Routed Events     141
Keyboard Events     150
Mouse Events     152
Stylus Events     156
Touch Events     158
Commands     170
Summary     176
Chapter 7: Structuring and Deploying an Application     177
Standard Desktop Applications     177
Navigation-Based Desktop Applications     193
Gadget-Style Applications     205
XAML Browser Applications     207
Loose XAML Pages     213
Summary     215
Chapter 8: Exploiting Windows Desktop Features     217
Jump Lists     217
Taskbar Item Customizations     229
Aero Glass     233
TaskDialog     236
Summary     239

Part III: Controls
Chapter 9: Content Controls     241

Buttons     243
Simple Containers     248
Containers with Headers     252
Summary     254
Chapter 10: Items Controls     255
Common Functionality     256
Selectors     261
Menus     298
Other Items Controls     302
Summary   &


Adam Nathan is a principal software architect for Microsoft in the Startup Business Group. Adam was previously the founding developer and architect for Popfly, Microsoft's first product built on Silverlight, named one of the 25 most innovative products of 2007 by PCWorld Magazine. Having started his career on Microsoft’s Common Language Runtime team, Adam has been at the core of .NET and WPF technologies since the very beginning.

Adam’s books have been considered required reading by many inside Microsoft and throughout the industry. He is the author of the best-selling WPF Unleashed (Sams, 2006) that was nominated for a 2008 Jolt Award, WPF 4 Unleashed (Sams, 2010), Windows 8 Apps with XAML and C# Unleashed (Sams, 2012), 101 Windows Phone 7 Apps (Sams, 2011), Silverlight 1.0 Unleashed (Sams, 2008), and .NET and COM: The Complete Interoperability Guide (Sams, 2002); a coauthor of ASP.NET: Tips, Tutorials, and Code (Sams, 2001); and a contributor to books including .NET Framework Standard Library Annotated Reference, Volume 2 (Addison-Wesley, 2005) and Windows Developer Power Tools (O’Reilly, 2006). Adam is also the creator of PINVOKE.NET and its Visual Studio add-in. You can find him online at www.adamnathan.net or @adamnathan on Twitter.

Reader Review(s)

Praise for the First Edition

“The Nathan book is brilliant--you’ll love it. Publishers, take note: I’d sure be buying a heck of a lot
more technical books if more of them were like this one.”
--Jeff Atwood, codinghorror.com, cofounder of Stack Overflow

Windows Presentation Foundation Unleashed is a must-have book for anyone interested in learning
and using WPF. Buy it, read it, and keep it close to your computer.”
--Josh Smith, Microsoft MVP

“As we built the feature team that delivered the new WPF presentation layer for Visual Studio 2010,
Windows Presentation Foundation Unleashed quickly became our must-read WPF reference book of
choice, over and above other books on WPF and indeed internal documentation. Highly recommended
for any developer wanting to learn how to make the most of WPF.”
--James Bartlett, senior lead program manager, Microsoft Visual Studio

“I’ve bought nearly all available WPF books, but the only one that’s still on my desk is Windows
Presentation Foundation Unleashed
. It not only covers all WPF aspects, but it does it in the right,
concise way so that reading it was a real pleasure.”
--Corrado Cavalli, Codeworks

Windows Presentation Foundation Unleashed is the most insightful WPF book there is. Don’t be misled
by its size; this book has the best introduction and deepest insights. This is the must-read for anyone
getting started or wanting to get the most out of WPF.”
--Jaime Rodriguez, Microsoft client evangelist for Windows, WPF, Silverlight, and Windows Phone

“I found Windows Presentation Foundation Unleashed to be an excellent and thorough introduction and
guide to programming WPF. It is clearly written, easily understood, and yet still deep enough to get a
good understanding of how WPF works and how to use it. Not a simple feat to accomplish! I heartily
recommend it to all the students who take DevelopMentor’s WPF course! Anyone serious about doing
WPF work should have a copy in their library.”
--Mark Smith, DevelopMentor instructor, author of DevelopMentor’s Essential WPF course

“I have read Windows Presentation Foundation Unleashed from cover to cover and have found it to be
really the most comprehensive material on WPF. I can’t think of even a single instance when I have not
been able to find the solution (or a pointer to one) every time that I have picked up the book to figure
out the intricacies of WPF.”
--Durgesh Nayak, team leader, Axis Technical Group

Windows Presentation Foundation Unleashed is the book that made WPF make so much sense for me.
Without Adam’s work, WPF would still be a mystery to me and my team. The enthusiasm for WPF is
evident from the offset and it really rubs off on the reader.”
--Peter O’Hanlon, managing director, Lifestyle Computing Ltd

“Adam Nathan’s Windows Presentation Foundation Unleashed must surely be considered one of the
seminal books on WPF. It has everything you need to help you get to grips with the learning cliff that
is WPF. It certainly taught me loads, and even now, after several years of full-time WPF development,
Windows Presentation Foundation Unleashed is never far from my hand.”
--Sacha Barber, Microsoft MVP, CodeProject MVP, author of many WPF articles

“Of all the books published about WPF, there are only three that I recommend. Windows Presentation
Foundation Unleashed
is my primary recommendation to developers looking to get up to speed quickly
with WPF.”
--Mike Brown, Microsoft MVP, Client App Development, and president of KharaSoft, Inc.