Defining “Constants”

I briefly mentioned in Chapter 2 that strings and other simple BCL (Base Class Library) types could potentially be defined as resources in XAML, but we didn't investigate the topic further at the time. Let's take a look at how we can define strings and other BCL types as resources in XAML. (We'll refer to these as constants.) For example, uses for this technique include maintaining common values in a theme file, and supporting localization in your application by maintaining a set of strings in resource dictionaries, which you can merge when appropriate with your application's resources.

images Note Only a limited number of types ...

Get Pro Business Applications with Silverlight 5 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.