title: Bind Listview to ObservableCollection
body: <p>I am trying to bind a listview to an ObservableCollection.</p>
  
  <p>I took a look at several topics on stack, but cannot find what I am doing wrong :</p>
  
  <p>My XAML looks like that (for GridViewColumn I tried both wih Path=, and without, as I saw both of them) :</p>
  
  <pre><code>&lt;ListView x:Name="ListView1"  ItemsSource="{Binding listeAff}"  Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="4" MouseDoubleClick="ListView_MouseDoubleClick" GridViewColumnHeader.Click="GridViewColumnHeaderClickedHandler" &gt;
              &lt;ListView.ContextMenu&gt;
                  &lt;ContextMenu x:Name="Context1"&gt;
                      &lt;MenuItem Header="{x:Static p:Resources.ContextSupprimer}" Click="Supprimer_Element"/&gt;
                      &lt;MenuItem x:Name="MenuBarNesting" Header="{x:Static p:Resources.ContextMiseEnBarre}" Click="Open_MiseEnBarre"/&gt;
                      &lt;MenuItem x:Name="MenuExportDSTV1" Header="{x:Static  p:Resources.ContextExport}" Click="Export_DSTV"/&gt;
                      &lt;MenuItem x:Name="AjouterAffaire" Header="{x:Static  p:Resources.AjouterAffaire}" Click="AjoutAffaire"/&gt;
                      &lt;MenuItem x:Name="ModifyAffaire" Header="{x:Static  p:Resources.Edit}" Click="ModifierAffaire"/&gt;
                  &lt;/ContextMenu&gt;
              &lt;/ListView.ContextMenu&gt;
              &lt;ListView.View&gt;
  
                  &lt;GridView AllowsColumnReorder="true" x:Name="GridView1"&gt;
                      &lt;GridViewColumn DisplayMemberBinding="{Binding Path=ID}" Header="ID" /&gt;
                      &lt;GridViewColumn DisplayMemberBinding= "{Binding Nom}" Header="{x:Static p:Resources.Nom}"/&gt;
                      &lt;GridViewColumn DisplayMemberBinding="{Binding Code}" Header="{x:Static p:Resources.Code}"/&gt;
                      &lt;GridViewColumn DisplayMemberBinding="{Binding Comm}" Header="{x:Static p:Resources.Commentaire}"/&gt;
  
                  &lt;/GridView&gt;
              &lt;/ListView.View&gt;
          &lt;/ListView&gt;
  </code></pre>
  
  <p>Then code behind is so :</p>
  
  <pre><code>public ObservableCollection&lt;Affaire&gt; listeAff { get; set; }
          public MainWindow()
          {
              Thread.CurrentThread.CurrentUICulture = new CultureInfo(Properties.Settings.Default.Langue);
              InitializeComponent();
              Initialisation();
              listeAff = new ObservableCollection&lt;Affaire&gt;();
              DBConnect DataBase = new DBConnect();
              string requete = "SELECT * FROM affaire ORDER BY ID";
              List&lt;Affaire&gt; liste = DataBase.Select_affaire(requete);
              foreach(Affaire aff in liste)
              {
                  listeAff.Add(aff);
              }
              DataContext = this;
  </code></pre>
  
  <p>On that part my ListView is shown correctly, but when I want to delete(for example) some objects in list, listview is not updated :</p>
  
  <pre><code>foreach (Affaire aff in ListView1.SelectedItems)
                      {
                          listeAff.Remove(aff);
                      }
  </code></pre>
  
  <p>What did I miss?</p>