private void OnPageLoaded(object sender, RoutedEventArgs e) { AdministrationClass.OpenNewModuleEntry(AdministrationClass.Modules.PlannedWorks); NotificationManager.ClearNotifications(AdministrationClass.Modules.PlannedWorks); if (_firstTimePageRun) { var backgroundWorker = new BackgroundWorker(); backgroundWorker.DoWork += (o, args) => { _firstTimePageRun = false; FillData(); }; backgroundWorker.RunWorkerCompleted += (o, args) => { BindingData(); SetDateProperties(); SetAccessEnable(_fullAccess); OnPlannedWorksDataGridSelectionChanged(null, null); var mainWindow = Application.Current.MainWindow as MainWindow; if (mainWindow != null) { mainWindow.HideWaitAnnimation(); } }; backgroundWorker.RunWorkerAsync(); } else { _taskClass.Fill(_dateFrom, _dateTo); RefillInfo(); var mainWindow = Application.Current.MainWindow as MainWindow; if (mainWindow != null) { mainWindow.HideWaitAnnimation(); } } }
private void SetRequestResponsibilities(DataRowView drv) { if (drv == null) { TechnologyProblemResponsibilitiesItemsControl.ItemsSource = null; return; } var globalId = drv["GlobalID"].ToString(); _taskClass.Fill(globalId); TechnologyProblemResponsibilitiesItemsControl.ItemsSource = _taskClass.Performers.Table.AsDataView(); }