I have a wpf application and I want to update my listview when I add new value through the UI using Observablecollect. But I don't get what I expect. When I add new value I won't update my list view.

Here is my CS file.

```
 using System.Collections.ObjectModel;
 using System.ComponentModel;
 using System.Data.SqlClient;
 using System.Windows;

 namespace ObservableCollectionTest
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
    public ObservableCollection<TestUser> NameList { get; set; }

    public MainWindow()
    {
        InitializeComponent();
        NameList = GetNamesFromDBAsStringList();
        ListViewNames.ItemsSource = NameList;
        this.DataContext = this;
    }

    private void Button_Click_1(object sender, RoutedEventArgs e)
    {
        TestUser user = new TestUser();
        user.UserName = txtName.Text;
        NameList.Add(user);

        //InsertUserName(txtName.Text);
        //NameList = GetNamesFromDBAsStringList();

        txtName.Clear();
        MessageBox.Show("User added");
    }

    private ObservableCollection<TestUser> GetNamesFromDBAsStringList()
    {
        ObservableCollection<TestUser> userList = new ObservableCollection<TestUser>();

        SqlConnection connection = new SqlConnection("Data Source=Chakrapani\\SQLEXPRESS;Initial Catalog=Test;Integrated Security=True");
        connection.Open();
        string sql = "select UserID,UserName from TestUser";
        SqlCommand command = new SqlCommand(sql, connection);
        SqlDataReader reader = command.ExecuteReader();
        while (reader.Read())
        {
            TestUser testUser = new TestUser();
            testUser.UserID = (int)reader[0];
            testUser.UserName = reader[1].ToString();
            userList.Add(testUser);
        }
        reader.Close();
        connection.Close();

        return userList;
    }

    private void InsertUserName(string userName)
    {
        SqlConnection connection = new SqlConnection("Data Source=CHAKRAPANI\\SQLEXPRESS;Initial Catalog=Test;Integrated Security=True");
        connection.Open();
        string sql = string.Format("insert into TestUser values ('{0}')", userName);
        SqlCommand command = new SqlCommand(sql, connection);
        command.ExecuteNonQuery();

        connection.Close();
    }
}

public class TestUser : INotifyPropertyChanged
{
    private int _userId;
    private string _userName;

    public int UserID
    {
        get { return _userId; }
        set
        {
            _userId = value;
            NotifyPropertyChanged("UserID");
        }
    }
    public string UserName
    {
        get { return _userName; }
        set
        {
            _userName = value;
            NotifyPropertyChanged("UserName");
        }
    }

    public event PropertyChangedEventHandler PropertyChanged;
    private void NotifyPropertyChanged(string propertyName)
    {
        if (PropertyChanged != null)
            PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    }
}
}

```

And this is my xaml file

```
<Window x:Class="ObservableCollectionTest.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="350" Width="396">
<Grid>
    <Button Content="Add User" HorizontalAlignment="Left" Margin="300,10,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click_1" Name="BtnAdd"/>
    <TextBox HorizontalAlignment="Left" Height="23" Margin="10,10,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="264" Name="txtName"/>
    <ListView HorizontalAlignment="Left" Height="259" Margin="10,51,0,0" VerticalAlignment="Top" Width="264" Name="ListViewNames" ItemsSource="{Binding MyUserNameList}">
        <ListView.View>
            <GridView>
                <GridViewColumn Header="User ID" DisplayMemberBinding="{Binding UserID}"/>
                <GridViewColumn Header="User Name" DisplayMemberBinding="{Binding UserName}"/>
            </GridView>
        </ListView.View>
    </ListView>

</Grid>

```

Please give me a clue to handle the problem.