title: WPF toolbar's style not working
body: <p>I'm using a resource dictionary in my wpf proyect. 
  The dictionary has these 2 styles:</p>
  
  <pre><code>&lt;Style x:Key="MyMenu" TargetType="Menu"&gt;
      &lt;Setter Property="Background" Value="Black"/&gt;
      &lt;Setter Property="Foreground" Value="White"/&gt;
  &lt;/Style&gt;
  
  &lt;Style x:Key="MyToolbar" TargetType="ToolBar"&gt;
      &lt;Setter Property="Background" Value="Black"/&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>And in my XAML file, I use these 2 styles as it follows:</p>
  
  <p>For the menu:</p>
  
  <pre><code>&lt;Menu Name="menuMainBar" Style="{DynamicResource MyMenu}" IsMainMenu="True" VerticalAlignment="Top" Margin="0,10,0,0"&gt;
          &lt;MenuItem ...
  &lt;/Menu&gt;
  </code></pre>
  
  <p>For the toolbar:</p>
  
  <pre><code>&lt;ToolBarTray Name="toolBarTrayRigth_wargames"  Orientation="Vertical" HorizontalAlignment="Left" VerticalAlignment="Top" Width="50"&gt;
              &lt;ToolBar Name="toolBarRigth_wargames" Style="{StaticResource MyToolbar}"  BorderThickness="0,0,1,0"&gt;
                          &lt;Button ...
              &lt;/ToolBar&gt;
  &lt;/ToolBarTray&gt;
  </code></pre>
  
  <p>This is the result:</p>
  
  <p><a href="https://i.stack.imgur.com/wDhpr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wDhpr.png" alt="Menu style working, toolbar style not working"></a></p>
  
  <p>As you can notice, the menu takes the style correctly, but the toolbar isn't affected by the style at all.</p>
  
  <p>I tried removing all the style elements from the toolbartray tag, as it follows:</p>
  
  <pre><code>&lt;ToolBarTray Name="toolBarTrayRigth_wargames"&gt;
          ...
  &lt;/ToolBarTray&gt;
  </code></pre>
  
  <p>And now the toolbar works, but as you can see, now the toolbarTray is not how I want it to be (I want a vertical toolbar, not a horizontal toolbar):</p>
  
  <p><a href="https://i.stack.imgur.com/Ti8H2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ti8H2.png" alt="Menu style working, toolbar style working, toolbartray not working"></a></p>
  
  <p>I also tried setting the background of the ToolBar directly in the xaml file:</p>
  
  <pre><code>&lt;ToolBarTray Name="toolBarTrayRigth_wargames"  Orientation="Vertical" HorizontalAlignment="Left" VerticalAlignment="Top" Width="50"&gt;
              &lt;ToolBar Name="toolBarRigth_wargames" BorderThickness="0,0,1,0"  Background="Black"&gt;
                          &lt;Button ...
              &lt;/ToolBar&gt;
  &lt;/ToolBarTray&gt;
  </code></pre>
  
  <p>...and it works:</p>
  
  <p><a href="https://i.stack.imgur.com/NdiTe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NdiTe.png" alt="Menu style working, toolbar style working, but not using the resource dictionary "></a></p>
  
  <p>But I don't want to do that, I want to use a resource dictionary for my toolbar's style.</p>
  
  <p>any ideas on how to achieve that?</p>