title: WPF ListView binding to a custom class
body: <p>My question is pretty much simple as it looks. But the way I am trying to implement it is a little complex. I have implemented a Singleton pattern in order to use some global data I have class Contact History, I want to bind some of its properties to the ListView->GridView->GridViewColumn. I have a list that I want to bind. I have gone through some tutorials and tried to implement them but it seems that there are some issues with my XAML code because when I bind the listobject it can resolve its path. It seems that I am not including something right. Following is the code that would be required </p>
  
  <p>Singleton Class</p>
  
  <pre><code>     class Singleton
          {
              private static Singleton instance = new Singleton();
              public List&lt;Contacts&gt; ContactList ;
  
              public SQLiteConnectionStringBuilder builder;
              public SqLiteProvider _db;
              public DataHelper _helper;
              public DataTable DataTable_Contacts;
              public DataTable DataTable_ContactHistory;
              public List&lt;String&gt; Contact_Names;
              public ListBox ListBox_names;
              public int Contact_Index;
              public int ContactHistory_Index;
  
              private Singleton()
              {
                  ContactList = new List&lt;Contacts&gt;();
  
                  builder = new SQLiteConnectionStringBuilder();
                  builder.DataSource = Util.GetCurrentDirectory() + "TestDatabases\\DatabaseAccessLayerSqlLite.db";
                  _db = new SqLiteProvider();
                  _db.ConnectionString = builder.ConnectionString;
                  _helper = new DataHelper(_db);
                  DataTable_Contacts = new DataTable();
                  DataTable_ContactHistory = new DataTable();
                  Contact_Names = new List&lt;string&gt;();
              }
         .
         .
  }
  </code></pre>
  
  <p>Xaml Code</p>
  
  <pre><code>&lt;Window x:Class="NET_Data_Access_Layer_Demo.MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:themes="clr-namespace:WPF.Themes;assembly=WPF.Themes"
          xmlns="clr-namespace:NET_Data_Access_Layer_Demo.Properties"
  
          Title="Customer Contact Manager" Height="535" Width="702" Loaded="Window_Loaded" Activated="Window_Activated"&gt;
          &lt;GroupBox Header="History" Height="230" HorizontalAlignment="Left" Margin="182,252,0,0" Name="groupBox_history" VerticalAlignment="Top" Width="487"&gt;
              &lt;Grid&gt;
                  &lt;Button Content="Edit" Height="23" HorizontalAlignment="Left" Margin="164,163,0,0" Name="button_edithistory" VerticalAlignment="Top" Width="75" Click="button_edithistory_Click" IsEnabled="False" /&gt;
                  &lt;Button Content="Delete" Height="23" HorizontalAlignment="Left" Margin="269,163,0,0" Name="button_deletehistory" VerticalAlignment="Top" Width="75" IsEnabled="False" Click="button_deletehistory_Click" /&gt;
                  &lt;Button Height="23" HorizontalAlignment="Left" Margin="62,163,0,0" Name="button_addhistory" VerticalAlignment="Top" Width="75" Click="button_addhistory_Click" Content="Add" IsEnabled="False" /&gt;
                  &lt;ListView IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding ContactHistoryList}" Height="129" HorizontalAlignment="Left" Margin="33,19,0,0" Name="listView_history" VerticalAlignment="Top" Width="419"&gt;
                      &lt;ListView.View&gt;
                          &lt;GridView&gt;
                              &lt;GridViewColumn Header="Date"  Width="80" DisplayMemberBinding="{Binding ContactHistory_Date}" /&gt;
                              &lt;GridViewColumn Header="Type"  Width="80" DisplayMemberBinding="{Binding ContactHistory_Type}" /&gt;
                              &lt;GridViewColumn Header="Note"  Width="300" DisplayMemberBinding="{Binding ContactHistory_Note}" /&gt;
                          &lt;/GridView&gt;
                      &lt;/ListView.View&gt;
                  &lt;/ListView&gt;
              &lt;/Grid&gt;
          &lt;/GroupBox&gt;
  .
  .
  .
  &lt;/window&gt;
  </code></pre>
  
  <p>I am assinging the datacontext properly, but its my hunch that the xaml can't understand all the binding references that I provided I might be missing some custom class reference or something like that. I would be obliged if anyone can help me in this regard</p>
  
  <p>Regards
  Umair</p>