public SemesterAverage() { InitializeComponent(); ResetViewModel(); Frame = this.frame; viewModel = new Cwa_EngineViewModel(); foreach (var item in CrudOperations.ProgramDictionary.Keys) { cboProgram.Items.Add(CrudOperations.ProgramDictionary[item]); } foreach (var item in CrudOperations.LevelDictionary.Keys) { cboLevel.Items.Add(CrudOperations.LevelDictionary[item]); } foreach (var item in CrudOperations.SemesterDictionary.Keys) { cboSemester.Items.Add(CrudOperations.SemesterDictionary[item]); } }
private void UserControl_Loaded(object sender, RoutedEventArgs e) { viewmodel = SemesterAverage.cachedViewModel; DG.DataContext = viewmodel.coursess; DG1.DataContext = viewmodel.output; }
public void ResetViewModel() { DataContext = viewModel; cachedViewModel = (Cwa_EngineViewModel)DataContext; }