예제 #1
0
 public ExportingDataWindow(EmployeesDBContext context)
 {
     InitializeComponent();
     ExportEmployees           = context.Employees.Local;
     OriginalEmployees         = context.Employees.Local;
     EmployeesGrid.ItemsSource = ExportEmployees.ToBindingList();
 }
예제 #2
0
        //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;
        }