views:

48

answers:

2

I have a wpf tab control which is highly customized through styles. I have referenced those styles in a resourcedictionary "TabControlResources". How do I reference "TabControlResources" in another resourcedictionary?. I have a resourcedictionary called "MainViewResources" and I would like to reference the tab style from my "TabControlResources" in that resourcedictionary.

Thanks in advance.

+2  A: 
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt;
<ResourceDictionary.MergedDictionaries>
    <ResourceDictionary
        Source="pack://application:,,,/path/to/TabControlResources.xaml" />
</ResourceDictionary.MergedDictionaries>

<other stuff...>

</ResourceDictionary>
chaiguy
Good answer, but you don't need the `pack://application:,,,/` in the Source string. In fact, that particular prefix is always superfluous in any `Application.LoadComponent` context because it is added automatically whenever a relative path is passed.
Ray Burns