private void LoadApplication(string appName) { SQL_general.UpdatePoweredOn(); switch (appName) { case "DockScheduleDisplay": var vm1 = new DockSchedule_VM(); var page1 = new DockSchedule { DataContext = vm1 }; Navigator.NavigationService = page1.NavigationFrame.NavigationService; page1.NavButtons.ShowPreview(); page1.Show(); break; case "DockScheduleTouch": var vm2 = new DockSchedule_VM(); var page2 = new DockSchedule { DataContext = vm2 }; Navigator.NavigationService = page2.NavigationFrame.NavigationService; page2.NavButtons.ShowInteractive(); page2.Show(); break; case "MachineOperations": var vm3 = new MachineOperations_VM(); var page3 = new MachineOperations(); Navigator.NavigationService = page3.NavigationFrame.NavigationService; page3.DataContext = vm3; page3.Show(); break; } }
private void ApplicationSelection_Click(object sender, RoutedEventArgs e) { var source = ((Button)sender).Tag; UpdateConfig(source.ToString()); switch (source) { case "MachineOperations": var moVm = new MachineOperations_VM(); var moPg = new MachineOperations { DataContext = moVm }; Navigator.NavigationService = moPg.NavigationFrame.NavigationService; moPg.Show(); break; case "DockScheduleTouch": var dstVm = new DockSchedule_VM(); var dstPg = new DockSchedule { DataContext = dstVm }; Navigator.NavigationService = dstPg.NavigationFrame.NavigationService; dstPg.Show(); break; case "DockScheduleDisplay": var dsdVm = new DockSchedule_VM(); var dsdPg = new DockSchedule { DataContext = dsdVm }; Navigator.NavigationService = dsdPg.NavigationFrame.NavigationService; dsdPg.Show(); break; } Close(); }