title: WPF Custom Control Template Not Applied
body: <p>I'm sure this question or derivatives of it have been asked a bazillion times, but I couldn't find anything that helped me solve the problem, so I'm asking. Please feel free to direct me to the duplicate that I'm sure exists but I can't find. Apparently I'm not so great with keywords.</p>
  
  <p>I have a Custom Control, it has it's own Resource Dictionary used only to define the control template. This dictionary is then merged into Generic.xaml.</p>
  
  <p>The problem is that when this control shows up in the UI, it has nothing inside of it. I used <a href="http://snoopwpf.codeplex.com/" rel="nofollow noreferrer">Snoop</a> to find this out. The control is in the UI, but it is completely empty.</p>
  
  <p>Below you'll find the items that I think are responsible for the problem. Any help or advice you can offer is greatly appreciated.</p>
  
  <p>The relevant parts of my folder structure are like this:</p>
  
  <p><img src="https://i.stack.imgur.com/J2tC1.png" alt="My Directory Structure"></p>
  
  <p><strong>BasicTemplate.xaml:</strong></p>
  
  <pre><code>&lt;ResourceDictionary
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:local="clr-namespace:WPFSpecBuilder.Layouts.Templates"&gt;
  
      &lt;Style TargetType="{x:Type local:BasicTemplate}"&gt;
          &lt;Setter Property="Template"&gt;
              &lt;Setter.Value&gt;
                  &lt;ControlTemplate TargetType="{x:Type local:BasicTemplate}"&gt;
                      &lt;Border Background="{TemplateBinding Background}"
                              BorderBrush="{TemplateBinding BorderBrush}"
                              BorderThickness="{TemplateBinding BorderThickness}"&gt;
                          &lt;Grid&gt;
                              &lt;TextBlock Text="This is a basic template." /&gt;
                          &lt;/Grid&gt;
                      &lt;/Border&gt;
                  &lt;/ControlTemplate&gt;
              &lt;/Setter.Value&gt;
          &lt;/Setter&gt;
      &lt;/Style&gt;
  &lt;/ResourceDictionary&gt;
  </code></pre>
  
  <p><strong>Generic.xaml</strong></p>
  
  <pre><code>&lt;ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt;
      &lt;ResourceDictionary.MergedDictionaries&gt;
          &lt;ResourceDictionary Source="Layouts/Templates/XAML/BasicTemplate.xaml" /&gt;
      &lt;/ResourceDictionary.MergedDictionaries&gt;
  &lt;/ResourceDictionary&gt;
  </code></pre>