title: Change WPF DataTemplate for one entry change
body: <p>In my wpf app, I've written Mouse double click event for ListBox entries. When I double click on single entry, it will be posted on server. My problem is, when I post any entry to server, I want to change DataTemplate of that entry only. In the below code which I've written, it posted all the entries to the server. so, please suggest the ways to change DataTemplate for single entry only. "Harvest_TimeSheetEntry" is my ListBox entry.</p>
  
  <p>Also see comments in the code.</p>
  
  <p>C# code:</p>
  
  <pre><code>    private void listBox1_MouseDoubleClick(object sender, MouseButtonEventArgs e)
      {
          //Submit clicked Entry
          if (sender is ListBoxItem)
          {
              ListBoxItem item = (ListBoxItem)sender;
              Harvest_TimeSheetEntry entryToPost = (Harvest_TimeSheetEntry)item.DataContext;
  
              if (!entryToPost.isSynced)
              {
                  //Check if something is selected in selectedClientItem and selectedProjectItem For that items
                  if (entryToPost.ClientNameBinding == "Select Client" || entryToPost.ProjectNameBinding == "Select Project")
                      System.Windows.MessageBox.Show("Please select your Project and Client");
                  else
                  {
                      Globals._globalController.harvestManager.postHarvestEntry(entryToPost);
                      System.Windows.MessageBox.Show("Entry posted");
                      DataTemplate tmpl = (DataTemplate)this.FindResource("DefaultDataTemplate");
                      listBox1.ItemTemplate = tmpl;   // **Here I want to change DataTemplate for only posted entry.**
                  }
              }
              else
              {
  
                  //Already synced.. Make a noise or something
                  System.Windows.MessageBox.Show("Already Synced;TODO Play a Sound Instead");
              }
          }
      } 
  </code></pre>