0

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.

William
  • 317
  • 2
  • 12

1 Answers1

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

<other stuff...>

</ResourceDictionary>
devios1
  • 36,899
  • 45
  • 162
  • 260
  • 1
    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 Jun 13 '10 at 09:24