title: WPF ObservableCollection & Listview
body: <p>I am trying to add a list of items to my Listview using ObservableCollection.
  when I build , I get this error in the line 2:  "StudentCollection" as follows:</p>
  
  <pre><code>  Inconsistent accessibility: property type System.Collections.ObjectModel.ObservableCollection&lt;HMSystem.ChildPage1.studentData&gt;' is  less accessible than property 'SHSystem.ChildPage1.studentCollection' d:\data\visual studio 2010\Projects\SSSystem\SHSystem\ChildPage1.xaml.cs
  </code></pre>
  
  <p>here is what I  have tried so far,</p>
  
  <pre><code>    // created a property 
      private ObservableCollection&lt;studentData&gt; _StudentCollection;
      public ObservableCollection&lt;studentData&gt; StudentCollection
      {
          get
          {
              if (_StudentCollection== null)
              {
                  _StudentCollection= new ObservableCollection&lt;studentData&gt;();
              }
              return _StudentCollection;
          }
      }
  
      //created a class for studentData
      class studentData
      {
          public string StudentName{ get; set; }
          public string Class{ get; set; }
          public string Status { get; set; }
      }
  </code></pre>
  
  <p>in the constructor :</p>
  
  <pre><code>         public ChildPage1()
           {
            _StudentCollection.Add(new studentData{ StudentName = "Arun", Class= "tenth", Status = "Active" });
           _StudentCollection.Add(new studentData{ StudentName = "Priya", Class= "ninth", Status = "Active" });
            InitializeComponent();
           }
  </code></pre>
  
  <p>in XAML :</p>
  
  <pre><code>        &lt;ListView Height="96" Name="listView1" Width="226" ItemsSource="{Binding  ElementName=Page1,Path=StudentCollection}"&gt;
               &lt;ListView.View&gt;
                &lt;GridView&gt;
                  &lt;GridViewColumn Width="50" Header="Name"   DisplayMemberBinding="{Binding StudentName}" /&gt;
                  &lt;GridViewColumn Width="70" Header="Class" DisplayMemberBinding="{Binding Class}" /&gt;
                  &lt;GridViewColumn Width="70" Header="Status" DisplayMemberBinding="{Binding Status}" /&gt;
                &lt;/GridView&gt;
              &lt;/ListView.View&gt;
         &lt;/ListView&gt;
  </code></pre>
  
  <p>any ideas ??
  Thanks </p>