public ExportingDataWindow(EmployeesDBContext context) { InitializeComponent(); ExportEmployees = context.Employees.Local; OriginalEmployees = context.Employees.Local; EmployeesGrid.ItemsSource = ExportEmployees.ToBindingList(); }
//the method that creates context and call the async method that load the data from csv file private async void LoadDataFromCSV(string path) { context = new EmployeesDBContext(0); EmployeesGrid.ItemsSource = context.Employees.Local.ToBindingList(); await Task.Run(() => LoadDataFromCSVAsync(path)); // async method call MessageBox.Show("Загружены все данные", "Уведомление", MessageBoxButton.OK, MessageBoxImage.Exclamation); LoadBarTextBlock.Text = "Все данные загружены"; Export_Button.IsEnabled = true; }