Note that there are some explanatory texts on larger screens.

plurals
  1. POSilverlight - Removing implicit styles from a section
    text
    copied!<p>I'm using <a href="http://silverlight.codeplex.com/" rel="nofollow">Silverlight toolkit</a> 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.</p> <p>Basically I want to do something like this:</p> <pre><code>&lt;theme:BureauBlackTheme&gt; &lt;StackPanel x:Name="LayoutRoot"&gt; &lt;StackPanel&gt;&lt;!-- Use the standard Bureau Black theme here --&gt;&lt;/StackPanel&gt; &lt;StackPanel&gt;&lt;!-- I don't want any implicit styling on this section --&gt;&lt;/StackPanel&gt; &lt;/StackPanel&gt; &lt;/theme:BureauBlackTheme&gt; </code></pre> <p>Looking at the source code of the Silverlight toolkit, I found that themes are applied by merging resource dictionaries:</p> <pre><code>... // Load the theme ResourceDictionary resources = null; using (stream) { resources = ResourceParser.Parse(stream, true); owner.MergedDictionaries.Add(resources); } ... </code></pre> <p>Where the theme files contain a bunch of implicit styles:</p> <pre><code>&lt;!--ScrollBar--&gt; &lt;Style TargetType="ScrollBar"&gt; &lt;Setter Property="MinWidth" Value="17" /&gt; ... </code></pre> <p>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 <a href="http://msdn.microsoft.com/en-us/library/cc265148%28v=vs.95%29.aspx" rel="nofollow">precedence of the control styles</a>).</p> <p>Is this possible in Silverlight 4? Workarounds are welcome too.</p> <p>Thanks in advance!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload