title: Bind HashTable to ListView in WPF
body: <p>I have a hash table and I want to bind it to a ListView in wpf in the code or code behind.</p>
  
  <p>My ListView is</p>
  
  <pre><code>  &lt;ListView Canvas.Left="1045" Canvas.Top="634" Height="244" Name="lvContact" Width="536" &gt;
              &lt;ListView.View&gt;
                  &lt;GridView x:Name="gvContacts"&gt;
                      &lt;GridView.Columns&gt;
                          &lt;GridViewColumn Width="200" x:Name="ContactName" DisplayMemberBinding="{Binding Path=Username}"&gt;&lt;/GridViewColumn&gt;
                      &lt;/GridView.Columns&gt;
                  &lt;/GridView&gt;
  
              &lt;/ListView.View&gt;
  
          &lt;/ListView&gt;
  </code></pre>
  
  <p>On the code beind I have no idea how to bind it, but before I was using this in a Windows Forms app</p>
  
  <pre><code>        //foreach (DictionaryEntry de in contactList)
          //{
          //    ListViewItem contactItem = new ListViewItem(de.Key.ToString());
  
          //    if (de.Value.ToString() == "NLN")
          //    {
          //        contactItem.ForeColor = System.Drawing.Color.Green;
          //    }
          //    else
          //    {
          //        contactItem.ForeColor = System.Drawing.Color.Gray;
          //    }
  
  
          //    lvContact.Items.Add(contactItem);
  
      //}
  </code></pre>
  
  <p>But now it doesnt work properly please help</p>