title: static resource cannot be resolved
body: <p>I am trying to implement MahApps style in my accounting system I follow the step needed here the link that I used <a href="http://mahapps.com/guides/quick-start.html#installation" rel="nofollow noreferrer">MahApps </a>.</p>
  
  <p>Here is the  code that I have I stuck in a error the resource <code>appbar_cupcake</code> cannot be resolved here is the code</p>
  
  <pre><code>&lt;Controls:MetroWindow x:Class="Hassab_Accounting_System.MainWindow"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      Title="MainWindow" Height="350" Width="525"&gt;
  &lt;Grid&gt;
  
  &lt;/Grid&gt;
  &lt;Controls:MetroWindow.RightWindowCommands&gt;
  &lt;Controls:WindowCommands&gt;
  &lt;Button Content="settings" /&gt;
  &lt;Button&gt;
    &lt;StackPanel Orientation="Horizontal"&gt;
      &lt;Rectangle Width="20" Height="20"
                 Fill="{Binding RelativeSource={RelativeSource AncestorType=Button},    Path=Foreground}"&gt;
        &lt;Rectangle.OpacityMask&gt;
          &lt;VisualBrush Stretch="Fill"
                       Visual="{StaticResource appbar_cupcake}" /&gt;
        &lt;/Rectangle.OpacityMask&gt;
      &lt;/Rectangle&gt;
      &lt;TextBlock Margin="4 0 0 0"
                 VerticalAlignment="Center"
                 Text="deploy cupcakes" /&gt;
    &lt;/StackPanel&gt;
    &lt;/Button&gt;
    &lt;/Controls:WindowCommands&gt;
    &lt;/Controls:MetroWindow.RightWindowCommands&gt;
    &lt;/Controls:MetroWindow&gt;
              `
     ![here is the error ][2]
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/4P2dS.png" alt="Exception"></p>