Using Entity Framework in a WPF application and wondering if I'm going about loading the data all wrong. I put the following in the code behind:
private void Window_Loaded(object sender, RoutedEventArgs e)
    {
        var invoices = db.Invoices.AsNoTracking().ToList();
        listbox1.ItemsSource = invoices;
    }
Loads ok, no problem there, however the window is not displayed until the data has loaded which is tedious. Is wWindow_loaded the best method/time to load it?
 
     
     
    