Пример #1
0
 /// <summary>
 /// Triggers when a user logs in.
 /// </summary>
 private void UserLoggedInEvent()
 {
     Dispatcher.Invoke(() =>
     {
         _weSketchAppPage = new WeSketchApp();
         mainFrame.NavigationService.Navigate(_weSketchAppPage);
     });
 }
Пример #2
0
        /// <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();
        }