title: WPF Grid.Resources Style breaks ResourceDictionary Style. How to make them coexist?
body: <p>In a WPF app I have a <code>ResourceDictionary</code> with <code>Style</code> defined for the <em>TargetType</em> <code>MyCustomControl</code>:</p>
  
  <pre><code>&lt;ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                  xmlns:cc="clr-namespace:MyControlLibrary;assembly=MyControlLibrary" &gt;
  
    &lt;Style TargetType="{x:Type cc:MyCustomControl}"&gt; 
      &lt;Setter Property="Prop1" Value="1" /&gt;
      &lt;Setter Property="Prop2" Value="2" /&gt;
      ...
  </code></pre>
  
  <p>The problem is that I need to define a context menu for <code>MyCustomControl</code> in the page XAML like following:</p>
  
  <pre><code>   &lt;Grid&gt;
       &lt;Grid.Resources&gt;
             &lt;ContextMenu x:Key="MyControlContextMenu"&gt;
                 &lt;MenuItem Name="Name1" 
                           Header="Header1" 
                           Click="Cm1_Click"
                           .../&gt;                   
                  ....
              &lt;/ContextMenu&gt;
         &lt;Style TargetType="{x:Type ScNamespace:MyCustomControl}"&gt;
           &lt;Setter Property="ContextMenu" Value="{StaticResource MyControlContextMenu}"/&gt;
         &lt;/Style&gt;
       &lt;/Grid.Resources&gt;
     ...
  </code></pre>
  
  <p>In this case, though I only assign one Property in the Style definition inside my Grid, the ResourceDictionary Style values are not applied at all. They get overridden by page resource style and ignored.</p>
  
  <p>How to solve this issue? Maybe there is a way to make a reference to ResourceDictionary in the Grid.Resources section to enforce looking up the ResourceDictionary Style? </p>