title: How to write style template to Popup control?
body: <p>I have a lot of popups in application (.NET Framework 4, WPF) and I have to set one style to all of them. 
  Example popup looks like that:</p>
  
  <pre><code>&lt;Popup PopupAnimation="Fade" MinWidth="600" MinHeight="200" Placement="Center" VerticalAlignment="Center" HorizontalAlignment="Center" IsEnabled="True" IsOpen="False"&gt;
      &lt;Grid Width="Auto" Height="Auto" Background="Gray"&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="30"/&gt;                   
              &lt;RowDefinition Height="Auto"/&gt;           
          &lt;/Grid.RowDefinitions&gt;
          &lt;Border BorderThickness="2" CornerRadius="8" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.RowSpan="2"&gt;
              &lt;Border.BorderBrush&gt;
                  &lt;SolidColorBrush Color="Gray"/&gt;
              &lt;/Border.BorderBrush&gt;
              &lt;Border.Background&gt;
                  &lt;SolidColorBrush Color="White"/&gt;
              &lt;/Border.Background&gt;
          &lt;/Border&gt;
  
          &lt;StackPanel Grid.Row="0"&gt;
              &lt;Label Foreground="Blue" Content="Popup_Title"/&gt;
          &lt;/StackPanel&gt;
  
          &lt;GroupBox Grid.Row="1" Header="Popup example content"&gt;
              &lt;StackPanel&gt;                      
                     ...                           
              &lt;/StackPanel&gt;
          &lt;/GroupBox&gt;      
      &lt;/Grid&gt;
  &lt;/Popup&gt;
  </code></pre>
  
  <p>How can I take styles like borders and background to a style template? 
  I can't write Style with TargetType Popup and modify it's <code>Property="Template"</code> because Popup Control doesn't have <code>Property="Template"</code>. So how can I write style to those Popups?</p>
  
  <p><strong>EDIT:</strong>
  Exact working style:</p>
  
  <pre><code>    &lt;Style x:Key="PopupContentStyle" TargetType="ContentControl"&gt;
      &lt;Setter Property="Template"&gt;
          &lt;Setter.Value&gt;
              &lt;ControlTemplate TargetType="ContentControl"&gt;
                  &lt;Grid Width="Auto" Height="Auto" Background="Gray"&gt;
                      &lt;Grid.RowDefinitions&gt;
                          &lt;RowDefinition Height="30"/&gt;
                          &lt;RowDefinition Height="Auto"/&gt;
                      &lt;/Grid.RowDefinitions&gt;
                      &lt;Border BorderThickness="2" CornerRadius="8" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.RowSpan="2"&gt;
                          &lt;Border.BorderBrush&gt;
                              &lt;SolidColorBrush Color="Gray"/&gt;
                          &lt;/Border.BorderBrush&gt;
                          &lt;Border.Background&gt;
                              &lt;SolidColorBrush Color="White"/&gt;
                          &lt;/Border.Background&gt;
                      &lt;/Border&gt;
  
                      &lt;StackPanel Grid.Row="0"&gt;
                          &lt;Label Foreground="Blue" Content="Popup_Title"/&gt;
                      &lt;/StackPanel&gt;
  
                      &lt;GroupBox Grid.Row="1" Header="Popup example content"&gt;
                          &lt;StackPanel&gt;
                              &lt;ContentPresenter /&gt;
                          &lt;/StackPanel&gt;
                      &lt;/GroupBox&gt;
                  &lt;/Grid&gt;
              &lt;/ControlTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
  &lt;/Style&gt;
  </code></pre>