title: Change selected ListBox Item DataTemplate on button click
body: <p>I have a view with a ListBox databound to an Observable Collection of Person.
  In the same view, I have a Button.
  What I'd like to do is select an item from the ListBox and have the selected item's DataTemplate replaced from "Person" to "PersonEdit" when I click on the button.</p>
  
  <p>I've looked at TemplateSelector, Triggers, etc, but can't seem to get anything to work.</p>
  
  <p>Any ideas?</p>
  
  <pre><code>&lt;DataTemplate x:Key="Person"&gt;
          &lt;TextBlock Text="{Binding Path=Name}"/&gt;
      &lt;/DataTemplate&gt;
  
      &lt;DataTemplate x:Key="PersonEdit"&gt;
          &lt;TextBox Text="{Binding Path=Name}"/&gt;
      &lt;/DataTemplate&gt;
  
  &lt;ListBox
          x:Name="lbPersons"
          Grid.Row="0"
          VerticalAlignment="Stretch"
          Margin="5"
          ItemsSource="{Binding Path=Persons}"
          ItemTemplate="{StaticResource ResourceKey=Person}"
          &gt;
      &lt;/ListBox&gt;
  
  &lt;Button
          Grid.Row="1"
          VerticalAlignment="Center"
          HorizontalAlignment="Center"
          Content="Add Person" Command="{Binding AddPerson}"/&gt;
  </code></pre>