/// <summary> /// Triggers when a user logs in. /// </summary> private void UserLoggedInEvent() { Dispatcher.Invoke(() => { _weSketchAppPage = new WeSketchApp(); mainFrame.NavigationService.Navigate(_weSketchAppPage); }); }
/// <summary> /// Handles the Closing event of the MainWindow control. Cleans up any instanciated objects. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.ComponentModel.CancelEventArgs"/> instance containing the event data.</param> private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (_loginPage != null) { _loginPage.Closing(); _loginPage = null; } if (_registrationPage != null) { _registrationPage.Closing(); _registrationPage = null; } if (_weSketchAppPage != null) { _weSketchAppPage.Closing(); _weSketchAppPage = null; } Application.Current.Shutdown(); }