title: Why is x:key required on ControlTemplate in the ResourceDictionary
body: <p>Consider the following XAML file:</p>
  
  <pre><code>&lt;Window x:Class="ExpressionVisualizer.MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:sle="clr-namespace:System.Linq.Expressions;assembly=System.Core"
          Title="MainWindow" Height="350" Width="525"&gt;
      &lt;Window.Resources&gt;
          &lt;DataTemplate DataType="{x:Type sle:BinaryExpression}"/&gt;
          &lt;ControlTemplate TargetType="{x:Type ContentControl}"/&gt;
      &lt;/Window.Resources&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>This is giving the following compile error:</p>
  
  <blockquote>
    <p>All objects added to an IDictionary must have a Key attribute or some
    other type of key associated with them. Line 10 Position 10.</p>
  </blockquote>
  
  <p>If I add an <code>x:key</code> attribute to the ControlTemplate, it compiles. However, I should not have to do that. The ControlTemplate is decorated with the DictionaryKeyProperty attribute which specifies TargetType as the key property. So as long as I specify a TargetType for my ControlTemplate, I should <strong>not</strong> have to specify an explicit key (similar to how I don't have to specify one on the DataTemplate I've defined).</p>
  
  <p>I have a second and tangentially related question. If I define a ControlTemplate in this way (either specifying a key or not) in the XAML, does it get automatically applied to all controls of type ContentControl that don't specify another template, or would I have to embed the ControlTemplate inside a Style for that to occur?</p>