Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Application.Resources Property

Gets or sets a collection of application-scope resources, such as styles and brushes.

Namespace: System.Windows
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:

public ResourceDictionary Resources { get; set; }
/** @property */
public ResourceDictionary get_Resources ()

/** @property */
public void set_Resources (ResourceDictionary value)

public function get Resources () : ResourceDictionary

public function set Resources (value : ResourceDictionary)

    <ResourceDictionary .../>

Property Value

A ResourceDictionary object that contains zero or more application-scope resources.

The Resources property can be used to share resources across the windows and elements of an application. Additionally, the Resources property is included in the resource lookup path, which is traversed in the following order:

  1. Elements

  2. Windows

  3. Application.Resources

  4. System

Consequently, user interface (UI) elements can bind to application-scope resources. Additionally, if resources change, the resource system ensures that element properties which are bound to those resources are automatically updated to reflect the change.

Application-scope resources provide a simple way to support a consistent theme across your application. You can easily create a theme in XAML by using the Application.Resources tag. However, if your application supports multiple themes, which may contain a large number of theme elements, it might be easier to manage them using one ResourceDictionary instance for each theme. In this way, a new theme can be applied by setting the Resources property to the appropriate ResourceDictionary. For more information, including an example, see the Themed Application Sample.

Resources is thread-safe, and is available from any thread.

This example illustrates how to use XAML together with application-scope resources to create a consistent visual appearance.


    <SolidColorBrush x:Key="BackgroundColor" Color="Yellow"></SolidColorBrush>


    Background="{StaticResource BackgroundColor}"



Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

© 2017 Microsoft