private Window GetView(string pageKey) { var viewType = (ViewType)Enum.Parse(typeof(ViewType), pageKey); CurrentPageKey = pageKey; Window window = null; switch (viewType) { case ViewType.Login: window = new LoginWindow(); break; case ViewType.Settings: window = new SettingsWindow(); break; case ViewType.Jobs: window = new JobsWindow(); break; case ViewType.Logs: window = new LogsWindow(); break; case ViewType.About: window = new AboutWindow(); break; default: throw new NotImplementedException(); } window.DataContext = WpfApp.Instance.GetDataContext(viewType); ((BaseViewModel)window.DataContext).NavigatedTo(); return(window); }
private void miJobs_Click(object sender, RoutedEventArgs e) { Views.JobsWindow window = new JobsWindow(); this.CpCurrentScreenContent.Content = window.Content; ResetMenuButtons(); this.miJobs.Background = Brushes.LightSlateGray; this.LblContentTitle.Content = "Jobs and Charges"; }