title: Conditional DataTemplate
body: <p>Here is what I am trying to do.  I have 2 Data Templates defined which both refer to a different user control.</p>
  
  <pre><code>&lt;UserControl.Resources&gt;
      &lt;DataTemplate x:Key="myDataTemplate1"&gt;
          &lt;Border BorderBrush="Black" BorderThickness="1"&gt;
              &lt;myUserControl1 /&gt;
          &lt;/Border&gt;
      &lt;/DataTemplate&gt;
      &lt;DataTemplate x:Key="myDataTemplate2"&gt;
              &lt;Border BorderBrush="Black" BorderThickness="1"&gt;
                  &lt;myUserControl2/&gt;
              &lt;/Border&gt;
      &lt;/DataTemplate&gt;
  &lt;/UserControl.Resources&gt;
  </code></pre>
  
  <p>I am using these Data Templates to display a list of items using ItemsControl like this:</p>
  
  <pre><code>&lt;ItemsControl x:Name="myItemList" ItemTemplate="{StaticResource myDataTemplate1}"&gt;
      &lt;ItemsControl.ItemsPanel&gt;
          &lt;ItemsPanelTemplate /&gt;
      &lt;/ItemsControl.ItemsPanel&gt;
  &lt;/ItemsControl&gt;
  </code></pre>
  
  <p>I would like the ItemTemplate to conditionally be either myDataTemplate1 or myDataTemplate1 depending on the value of an integer variable being 1 or 2 respectively.</p>
  
  <p>Should I use DataTriggers for this or is there another way to do this? Appreciate the help.</p>