tags:

views:

21

answers:

1

If I write

test = Application.Current.FindResource(SystemColors.ActiveBorderBrushKey);

test will have a value even though Application.Current.Resources is empty.

How does it work?

A: 

FindResource will first look in application-scope resources for the specified resource. Application-scope resources are managed by Application, and are exposed from the Resources property.

If the specified resource is not found in the set of application-scope resources, FindResource then next searches the system resources. System resources are shell resources defined by the user, and include colors, fonts, and shell configurations. These are exposed from the SystemColors, SystemFonts, and SystemParameters types, respectively, as static properties.

http://msdn.microsoft.com/en-us/library/system.windows.application.findresource.aspx

Robert Harvey