Organizing Template Resources
When using control templates, you need to decide how broadly you want to share your templates and whether you want to apply them automatically or explicitly.
The first question asks you to think about where you want to use your templates. For example, are they limited to a specific window? In most situations, control templates apply to multiple windows, and possibly even the entire application. To avoid defining them more than once, you can define them in the Resources collection of the Application class, as described in Chapter 11.
However, this raises another consideration. Often, control templates are shared between applications. It's quite possible that a single application might use templates that have been ...
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.