/// <summary> /// Initializes a new instance of the <see cref="HomeViewModel"/> class. /// </summary> public HomeViewModel() { ManageSchedulers.SetLogFileName(0); MenuClickCommand = new BaseCommand(MenuClick); InputCommand = new BaseCommand(UserInput); StatusUpdate.StatusChanged += StatusUpdate_StatusChanged; StatusUpdate.PopUpStatusChanged += (isPopUpOpen) => { IsPopupOpen = isPopUpOpen; }; StatusUpdate.StatusMessage = Utilities.GetResourceValue("Loading"); ThreadHelper.RunBackGround(delegate { Element = new StartupViewModel(this); }); }
/// <summary> /// Handles the Startup event of the Application control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="StartupEventArgs"/> instance containing the event data.</param> private void Application_Startup(object sender, StartupEventArgs e) { InitializeService.InitializeConnectionStrings(true); if (e.Args.Length > 0) { try { ManageSchedulers.StartScheduler(e.Args); } catch (System.Exception exception) { Logger.LogMessage(exception.Message, "StartUp", LogType.Error, exception); } CloseApp(); } else { Current.DispatcherUnhandledException += AppDispatcherUnhandledException; var homeView = new Home(); homeView.Show(); homeView.Closed += HomeView_Closed; } }