wolfgang ziegler

„make stuff and blog about it“

How to create a ResourceDictionary in Windows Phone 7?

July 27, 2011

The Visual Studio templates do not offer the creation of a ResourceDictionary for Windows Phone 7 Silverlight applications by default. However, you can create and add one manually.

As a first step, just add an existing .xaml file to your project and make sure its BuildAction property is set to Resource.


The file should contain at least these lines of XAML code.


Then, define whatever resources your application needs inside this dictionary.

To use the defined resources, simply include the dictionary in your PhoneApplicationPage with these lines of code:

    <ResourceDictionary x:Key="dict">
        <ResourceDictionary Source="ResourceDictionary.xaml"/>