title: how to change background color of selected item in a listbox programmatically?
body: <p>I am trying to change background-color of selected item of a listbox. it changes background-color but next time if I select another item, then background-color of previous selected item should set to null or default.</p>
  
  <p>Listbox name is lstContacts.</p>
  
  <p>private void lstContacts_SelectionChanged(object sender, SelectionChangedEventArgs e)</p>
  
  <pre><code>lstContacts.ClearValue(ListBox.BackgroundProperty);//its not working   
   ListBoxItem item = lstContacts.ItemContainer.ContainerFromItem(lstContacts.SelectedItem) as ListBoxItem;
  item.Background = new SolidColorBrush(Colors.Red);
  </code></pre>
  
  <p>can anyone help me?</p>