The Last Word

In this chapter, you took a quick look at the WPF application model. To manage a simple WPF application, you need to do nothing more than create an instance of the Application class and call the Run() method. However, most applications go further and derive a custom class from the Application class. And as you saw, this custom class is an ideal tool for handling application events and an ideal place to track the windows in your application or implement a single-instance pattern.

You haven't quite plumbed the full reaches of the Application class—there's still a Resources collection to consider, where you can define objects you want to reuse throughout your application, like styles that can be applied to controls in multiple windows. ...

Get Pro WPF in C# 2008: Windows Presentation Foundation with .NET 3.5, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.