This is probably a really stupid question but I can't figure this out.
I have a page with a MergeDictionary defined:
<navigation:Page.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Assets/TourneySetupStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</navigation:Page.Resources>
and I reference the styles in TourneySetupStyles.xaml in my XAML like this with no problem:
<TextBlock Text="Tourney Name:" Style="{StaticResource TourneySetupTextStyle}" />
However, now I need to add another page resource like this:
But the designer now throws a warning: "The designer does not support loading dictionaries that mix 'ResourceDictionary' items without a key and other items in the same collection. Please ensure that the 'Resources' property does not contain 'ResourceDictionary' items without a key, or that the 'ResourceDictionary' item is the only element in the collection."
So I add a key to my ResourceDictionary like this:
<navigation:Page.Resources>
<local:Tournament x:Key="tournament" />
<ResourceDictionary x:Key="whatever">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Assets/TourneySetupStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</navigation:Page.Resources>
and the warning goes away. BUT now my reference to the style in TourneySetupStyles no longer works:
"Cannot find a Resource with the Name/Key TourneySetupTextStyle"
So I guess the question is: How do I access the style now that the ResourceDictionary is keyed?