title: MVVM binding ObservableCollection to Listview Not working
body: <p>I am new to MVVM, I am trying to bind ObservableCollection to Listview.</p>
  
  <p>ViewModel</p>
  
  <pre><code>namespace Multiwindow.Viewmodel
  {
  
      public class ViewModelBase
      {
          public Commandclass Cclass { get; set; }
  
          private ObservableCollection&lt;Person&gt; observableprsn = new ObservableCollection&lt;Person&gt;();
  
          public ViewModelBase()
          {
              Cclass = new Commandclass(this);
          }
  
          public void oncommand()
          {   
              for (int i = 0; i &lt; 5; i++)
              {
                  Person p = new Person();
                  p.Name = "name";
                  p.Lastname = "lastname" + i;
                  observableprsn.Add(p);
              }           
          }
      }
  }
  </code></pre>
  
  <p>View</p>
  
  <pre><code> &lt;Window.Resources&gt;
          &lt;m:Person x:Key="personmodel"/&gt;
          &lt;vm:ViewModelBase x:Key="vmodel"/&gt;
      &lt;/Window.Resources&gt;
  
      &lt;Grid Background="Gray" DataContext="{StaticResource vmodel}"&gt;
  
              &lt;Button Content="Load Window 2" Margin="155,108,177,157"
                      Command="{Binding Cclass, Source={StaticResource vmodel}}" /&gt;
  
              &lt;ListView HorizontalAlignment="Left" Height="100" Width="184" 
                        DataContext="{Binding Source={StaticResource vmodel}}"
                        ItemsSource="{Binding }"&gt;
                  &lt;ListView.View&gt;
                      &lt;GridView&gt;
                          &lt;GridViewColumn Header="Name"  DisplayMemberBinding="{Binding Name}"/&gt;
                          &lt;GridViewColumn Header="Address"  DisplayMemberBinding="{Binding Lastname}"/&gt;
                      &lt;/GridView&gt;
                  &lt;/ListView.View&gt;
              &lt;/ListView&gt;
  
          &lt;/Grid&gt;
  </code></pre>
  
  <p>On button click i am binding to listview some data in loop of class person with propert Name and Lastname, where am i Wrong. thanks</p>