title: How to update observable collection on property change and also store it on every change?
body: <p>I have dynamic listbox contains textbox to display list items and so I can edit listbox item. My application setting file contains  string collection which I want to bind for that listbox. I also want to update that setting files on every change of listbox item, I created class which implements INotifyProprtyChanged. I have converted string collection from settings file into observable collection of custom type which has string property.  I bind textbox to property of that custom class and update source property on property change. I want to update observable collection as well. and that updates my app setting file as well. Please help me on this. Any help would be really appreciated. My code:</p>
  
  <pre><code>public class WindowViewModel : INotifyPropertyChanged
  {
  
      private ObservableCollection&lt;UrlModel&gt; customcollection;
  
      public ObservableCollection&lt;UrlModel&gt; CustomCollection
      {
          get { return customcollection; }
          set
          {
              customcollection = value;
              NotifyPropertyChanged("CustomCollection");
          }
      }
      public event PropertyChangedEventHandler PropertyChanged;
      protected void NotifyPropertyChanged(string property)
      {
          if (PropertyChanged != null)
              PropertyChanged(this, new PropertyChangedEventArgs(property));
      }
  
      public WindowViewModel()
      {
          List&lt;string&gt; customlist = Properties.Settings.Default.CustomList.Cast&lt;string&gt;().ToList();
          List&lt;UrlModel&gt; urllist = new List&lt;UrlModel&gt;();
          urllist = customlist.Select(item =&gt; new UrlModel() { urlString = item }).ToList();
          CustomCollection = new ObservableCollection&lt;UrlModel&gt;(urllist);
      }
  }
  
  public class UrlModel : INotifyPropertyChanged
  {
  
      private string url;
  
      public string urlString
      {
          get { return url; }
          set
          {
              url = value;
              NotifyPropertyChanged("urlString");
  
          }
  
      }
  
      public event PropertyChangedEventHandler PropertyChanged;
  
      protected void NotifyPropertyChanged(string property)
      {
          if (PropertyChanged != null)
              PropertyChanged(this, new PropertyChangedEventArgs(property));
  
      }
  }
  
  
  /// &lt;summary&gt;
  /// Interaction logic for MainWindow.xaml
  /// &lt;/summary&gt;
  public partial class MainWindow : Window
  {
      public MainWindow()
      {
          InitializeComponent();
  
          ViewModel = new WindowViewModel();
          ListTwo.ItemsSource = ViewModel.CustomCollection;
      }
  
      private WindowViewModel viewModel;
  
      public WindowViewModel ViewModel
      {
          get { return viewModel; }
          set{
              viewModel = value;
              DataContext = value;
          }
      }
  }   
  </code></pre>
  
  <p>}</p>