Saturday, September 12, 2009

Merging dictionaries in Silverlight 3

In Silverlight 3 you can merge dictionaries. Something that I really like because it enables you even better to separate reusable things from one time things.

When you try to do that, watch for a couple of things.

<Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="/S7Silverlight;component/Themes/Generic.xaml" />
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</Application.Resources>

Don’t forget: (1) the slash before the name of the Assembly and (2) to put component/ before the path to the resource file in the assembly

Just thought it might save you the hour I just spent.

Bye,

Bart