title: Error in Sub-Menu Template in WPF
body: <p>I am using Header-Menu Template as well as Sub-Menu-Header Template. The Main Header Menu Working well but the Sub-Menu isn't working. It doesn't show.</p>
  
  <p>My Wpf XAML code (Sub Menu Header Template) :</p>
  
  <pre><code>    &lt;ControlTemplate x:Key="{x:Static MenuItem.SubmenuHeaderTemplateKey}"  TargetType="{x:Type MenuItem}"&gt;
          &lt;Border x:Name="Border" BorderThickness="1"&gt;
              &lt;Grid&gt;
                  &lt;Grid.ColumnDefinitions&gt;
                      &lt;ColumnDefinition Width="Auto"    SharedSizeGroup="Icon" /&gt;
                      &lt;ColumnDefinition Width="*" /&gt;
                      &lt;ColumnDefinition Width="Auto"   SharedSizeGroup="Shortcut" /&gt;
                      &lt;ColumnDefinition Width="13" /&gt;
                  &lt;/Grid.ColumnDefinitions&gt;
                  &lt;ContentPresenter x:Name="Icon"  Margin="6,0,6,0" VerticalAlignment="Center"  ContentSource="Icon" /&gt;
                  &lt;ContentPresenter x:Name="HeaderHost" Grid.Column="1" ContentSource="Header"  RecognizesAccessKey="True" /&gt;
                  &lt;TextBlock x:Name="InputGestureText"  Grid.Column="2" Text="{TemplateBinding InputGestureText}" Margin="5,2,2,2" DockPanel.Dock="Right" /&gt;
                  &lt;Path Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 0 0 L 0 7 L 4 3.5 Z"&gt;
                      &lt;Path.Fill&gt;
                          &lt;SolidColorBrush Color="White"  /&gt;
                      &lt;/Path.Fill&gt;
                  &lt;/Path&gt;
                  &lt;Popup x:Name="Popup" Placement="Right" HorizontalOffset="-4" IsOpen="{TemplateBinding IsSubmenuOpen}" AllowsTransparency="True" Focusable="False" PopupAnimation="Fade"&gt;
                      &lt;Border x:Name="SubmenuBorder" SnapsToDevicePixels="True" Background="RoyalBlue"  BorderThickness="1"&gt;
                          &lt;Border.BorderBrush&gt;
                              &lt;SolidColorBrush Color="RoyalBlue" /&gt;
                          &lt;/Border.BorderBrush&gt;
                      &lt;/Border&gt;
                  &lt;/Popup&gt;
              &lt;/Grid&gt;
          &lt;/Border&gt;
          &lt;ControlTemplate.Triggers&gt;
              &lt;Trigger Property="Icon" Value="{x:Null}"&gt;
                  &lt;Setter TargetName="Icon"   Property="Visibility"  Value="Collapsed" /&gt;
              &lt;/Trigger&gt;
              &lt;Trigger Property="IsHighlighted" Value="true"&gt;
                  &lt;Setter Property="Background" TargetName="Border"&gt;
                      &lt;Setter.Value&gt;
                          &lt;LinearGradientBrush EndPoint="0.5,1"  StartPoint="0.5,0"&gt;
                              &lt;GradientStop Color="Transparent" Offset="0" /&gt;
                              &lt;GradientStop Color="DeepSkyBlue" Offset="1" /&gt;
                          &lt;/LinearGradientBrush&gt;
                      &lt;/Setter.Value&gt;
                  &lt;/Setter&gt;
                  &lt;Setter Property="BorderBrush" TargetName="Border"&gt;
                      &lt;Setter.Value&gt;
                          &lt;LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"&gt;
                              &lt;GradientStop Color="DeepSkyBlue"   Offset="0" /&gt;
                              &lt;GradientStop Color="Transparent"  Offset="1" /&gt;
                          &lt;/LinearGradientBrush&gt;
                      &lt;/Setter.Value&gt;
                  &lt;/Setter&gt;
              &lt;/Trigger&gt;
              &lt;Trigger SourceName="Popup" Property="AllowsTransparency" Value="True"&gt;
                  &lt;Setter TargetName="SubmenuBorder" Property="CornerRadius" Value="4" /&gt;
                  &lt;Setter TargetName="SubmenuBorder" Property="Padding" Value="0,3,0,3" /&gt;
              &lt;/Trigger&gt;
              &lt;Trigger Property="IsEnabled" Value="false"&gt;
                  &lt;Setter Property="Foreground"&gt;
                      &lt;Setter.Value&gt;
                          &lt;SolidColorBrush Color="DeepPink" /&gt;
                      &lt;/Setter.Value&gt;
                  &lt;/Setter&gt;
              &lt;/Trigger&gt;
          &lt;/ControlTemplate.Triggers&gt;
      &lt;/ControlTemplate&gt;
  </code></pre>
  
  <p>Apply to Design : </p>
  
  <pre><code> &lt;Grid&gt;
      &lt;Menu Height="24" VerticalAlignment="Top" Style="{DynamicResource HiMicrosoft}"&gt;
          &lt;MenuItem Header="Media" Width="48"&gt;
              &lt;MenuItem Header="Open Files" Template="{DynamicResource MI }"/&gt;
              &lt;MenuItem Header="Open Folder" Template="{DynamicResource MI }"/&gt;
              &lt;MenuItem Header="Open Playlist" Template="{DynamicResource MI }"/&gt;
              &lt;MenuItem Header="Open Recent" Template="{DynamicResource MI }"/&gt;
              &lt;Separator Style="{DynamicResource {x:Static MenuItem.SeparatorStyleKey} }"/&gt;
              &lt;MenuItem Header="Hide" Template="{DynamicResource MI }"/&gt;
              &lt;MenuItem Header="Exit" Template="{DynamicResource MI }"/&gt;
          &lt;/MenuItem&gt;
          &lt;MenuItem Header="Playback" &gt;
              &lt;MenuItem Header="Play/Pause" Template="{DynamicResource MI }"/&gt;
              &lt;MenuItem Header="Stop" Template="{DynamicResource MI }"/&gt;
              &lt;Separator Style="{DynamicResource {x:Static MenuItem.SeparatorStyleKey} }" /&gt;
              &lt;MenuItem Header="Speed" Template="{DynamicResource MI }"&gt;
                  &lt;MenuItem  Header="Stop"  Template="{DynamicResource {x:Static MenuItem.SubmenuHeaderTemplateKey}}"/&gt;
              &lt;/MenuItem&gt;
          &lt;/MenuItem&gt;
      &lt;/Menu&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p>And here is final output screenshot :
  <a href="https://i.stack.imgur.com/eRZnF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eRZnF.png" alt="SS"></a></p>
  
  <p>When I click on speed it shows nothing. 
  I can't identify the mistake or may be I have used wrong method.</p>
  
  <p>Any help will be appreciate!</p>
  
  <p>If you want I can provide more details. Just comment below.</p>
  
  <p>Thanks in advance!</p>