WPF Datagrid: Update itemssource the simple way
<p>first of all, I normally write code using MVVM or MVVMC, but for a very simple project, I want to try doing everything the "old way", meaning writing a simple to understand app using only code behind logic, and no INotifyPropertyChanged interface.</p>

<p>For that purpose, I have created a very simple Employee sample app with a class that loads a list of Employees to an Obersvablecolletion. The problem ist: after I set the Itemssource and DataContext, after Loading, my DataGrid does not get updated. Of course I could set the DataContext again after loading, but is there a better way to do so? Some kind of telling the DataGrid in code behind that its contents have changed and Invaldiate them?</p>

<p>Here is my sample code:</p>

<pre><code>public partial class MainWindow : Window
{
    private EmployeeList _MyList;

    public MainWindow()
    {
        InitializeComponent();
         _MyList= new EmployeeList();            
         _MyList.Employees = new ObservableCollection&lt;Employee&gt;();                        
        _MyGrid.DataContext = _MyList;
        _MyGrid.ItemsSource = _MyList.Employees;
    }

    private void DataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
    {

    }

    private void _AddButton_Click(object sender, RoutedEventArgs e)
    {
        AddWindow newWindow = new AddWindow();
        if (newWindow.ShowDialog() == true)
        {
            _MyList.Employees.Add(newWindow.NewEmployee);
        }

    }

    private void _LoadButton_Click(object sender, RoutedEventArgs e)
    {
        _MyList.Load();            
        //Creates new_MyList.Employees and fills with content from a file. After that, my DataGrid does not get updated
    }
</code></pre>