I'm using Silverlight toolkit to set the styling for my whole application. Now I need to remove the implicit styling from a specific section, so that it doesn't interfere with other styling in that section.
Basically I want to do something like this:
<theme:BureauBlackTheme>
<StackPanel x:Name="LayoutRoot">
<StackPanel><!-- Use the standard Bureau Black theme here --></StackPanel>
<StackPanel><!-- I don't want any implicit styling on this section --></StackPanel>
</StackPanel>
</theme:BureauBlackTheme>
Looking at the source code of the Silverlight toolkit, I found that themes are applied by merging resource dictionaries:
...
// Load the theme
ResourceDictionary resources = null;
using (stream)
{
resources = ResourceParser.Parse(stream, true);
owner.MergedDictionaries.Add(resources);
}
...
Where the theme files contain a bunch of implicit styles:
<!--ScrollBar-->
<Style TargetType="ScrollBar">
<Setter Property="MinWidth" Value="17" />
...
Therefore, I need a way to remove all the implicit styles from a specific section, but only from that section. The reason I need this, is because these styles are interfering with the styling of a third party control (I think this has to do with the precedence of the control styles).
Is this possible in Silverlight 4? Workarounds are welcome too.
Thanks in advance!