I have a user control (a modernTab, provded by modernui) that has a style applied to it, as is specified in a resource dictionary (that again came with modernui).
That's fine, styling for this app is provided through some default resources in the App.xaml file that look like this:
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/FirstFloor.ModernUI;component/Assets/ModernUI.xaml" />
<ResourceDictionary Source="/FirstFloor.ModernUI;component/Assets/ModernUI.Light.xaml"/>
</ResourceDictionary.MergedDictionaries>
That's well and good. However, I want to override the link style I am using for a specific instance of a modernTab. So in my XAML, I'm trying to do it like this:
<mui:ModernTab ListWidth="Auto"
Layout="List"
Links ="{Binding MyViewModelLinks}">
<mui:ModernTab.Resources>
<Style TargetType="ListBoxItem">
<Setter Property="Foreground" Value="Black" />
<Setter Property="Background" Value="Yellow" />
</Style>
</mui:ModernTab.Resources>
</mui:ModernTab>
Now, I know from looking at the source that down inside the guts of a modernTab control it's got a bunch of ListBoxItems - these are what I want to change the style on.
What I don't get is why my "local" style isn't going down and overriding for this specific instance. Any ideas?
I tried defining my style override in App.xaml (even though I don't really want it to be global) and it didn't work. Clearly I'm missing something.