title: How can I change Item and Content Templates based on the object type?
body: <p>I have a WPF <code>TabControl</code> that I have set the <code>ItemTemplate</code> as well as the <code>ContentTemplate</code>. This tab control displays Call Log information based on customer tech support information.</p>
  
  <p>Inside of this same control, I would also like to be able to show a <code>ReturnAuthorization</code> template.</p>
  
  <p>I would like to swap these out based on the object type added to the <code>TabControl</code>'s Items collection. Is this something that is possible?</p>
  
  <p>I have some Pseudo-code that sort of shows what I want to pull off:</p>
  
  <pre><code>&lt;TabControl x:Name="tabCases" IsSynchronizedWithCurrentItem="True" ItemContainerStyle="{StaticResource ClosableTabItemTemplate}"  &gt;
          &lt;TabControl.ItemTemplate&gt;
              if ( Type is Entities:Case )
              {
              &lt;DataTemplate DataType="{x:Type Entities:Case}"&gt;
                      &lt;TextBlock Text="{Binding Path=Id}" /&gt;
              &lt;/DataTemplate&gt;
              }
              else if ( Type is Entities1:RAMaster )
              {
              &lt;DataTemplate DataType="{x:Type Entities1:RAMaster}"&gt;
                  &lt;TextBlock Text="{Binding Path=Id}" /&gt;
                  &lt;/DataTemplate&gt;
              }
          &lt;/TabControl.ItemTemplate&gt;
          &lt;TabControl.ContentTemplate&gt;
              &lt;DataTemplate DataType="{x:Type Entities:Case}"&gt;
                  &lt;CallLog:CaseReadOnlyDisplay DataContext="{Binding}" /&gt;
              &lt;/DataTemplate&gt;
          &lt;/TabControl.ContentTemplate&gt;
      &lt;/TabControl&gt;
  </code></pre>