title: WPF Template.FindName return always null
body: <p>Template</p>
  
  <pre><code>&lt;Style TargetType="{x:Type local:Viewport}"&gt;
      &lt;Setter Property="Template"&gt;
          &lt;Setter.Value&gt;
              &lt;ControlTemplate TargetType="{x:Type local:Viewport}"&gt;
                  &lt;Border Background="{TemplateBinding Background}"
                          BorderBrush="{TemplateBinding BorderBrush}"
                          BorderThickness="{TemplateBinding BorderThickness}"&gt;
                      &lt;ItemsPresenter/&gt;
                  &lt;/Border&gt;
              &lt;/ControlTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
      &lt;Setter Property="ItemsPanel"&gt;
          &lt;Setter.Value&gt;
              &lt;ItemsPanelTemplate&gt;
                  &lt;Canvas x:Name="PART_Canvas" IsItemsHost="True"/&gt;
              &lt;/ItemsPanelTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>And the code in OnApplyTemplate</p>
  
  <pre><code>content = this.Template.FindName("PART_Canvas", this) as FrameworkElement;
  </code></pre>
  
  <p>the content returns always null, why it doesn't work?</p>
  
  <p>if I replace with this, the program quits directly</p>
  
  <pre><code>content = this.ItemsPanel.FindName("PART_Canvas", this) as FrameworkElement;
  </code></pre>