title: Define different DataTemplate for same source
body: <p>I'm trying to show collection of bool with a DataTemplate for ListView.
  Here's the code:</p>
  
  <p>In MainWindow.xaml</p>
  
  <pre><code>&lt;Window.Resources&gt;       
      &lt;DataTemplate x:Key="ListItemCheckBoxTemplate"&gt;
          &lt;CheckBox IsChecked="{Binding Mode=OneWay}"/&gt;
      &lt;/DataTemplate&gt;
      &lt;DataTemplate x:Key="ListItemRadioButtonTemplate"&gt;
          &lt;RadioButton IsChecked="{Binding Mode=OneWay}"/&gt;
      &lt;/DataTemplate&gt;
  &lt;/Window.Resources&gt;
  &lt;Grid&gt;
      &lt;Grid.ColumnDefinitions&gt;
          &lt;ColumnDefinition Width="120"/&gt;
          &lt;ColumnDefinition Width="*"/&gt;
      &lt;/Grid.ColumnDefinitions&gt;        
      &lt;TextBlock Text="ListViewSample" /&gt;
      &lt;ListBox ItemsSource="{Binding MyData}" ItemTemplate="{StaticResource ListItemCheckBoxTemplate}" Grid.Column="1"/&gt;                    
  &lt;/Grid&gt;
  </code></pre>
  
  <p>In MainWindow.xaml.cs</p>
  
  <pre><code>public partial class MainWindow : Window
  {
      public MainWindow()
      {
          InitializeComponent();
          this.DataContext = new ViewModel();  
      }
  }
  
  public class ViewModel
  {
      private List&lt;bool&gt; myBooleanCollection;
      public List&lt;bool&gt; MyData
      {
          get { return myBooleanCollection;  }
          set { myBooleanCollection = value; }
      }
  
      public ViewModel()
      {
          myBooleanCollection = new List&lt;bool&gt;();
          myBooleanCollection.Add(true);
          myBooleanCollection.Add(false);
          myBooleanCollection.Add(true);
          myBooleanCollection.Add(true);
          myBooleanCollection.Add(false);            
      }
  }
  </code></pre>
  
  <p>Instead of ItemTemplate ListItemCheckBoxTemplate I want to apply ListItemRadioButtonTemplate with Radio button. How I can specify the use of ItemTemplate for the same source in xaml. Do I need to change the DataSource for the same or
  do I have some way to specify the DataTemplate in xaml based on condition.</p>