private void _model_initializationProgress(object sender, EventArgs e) { HelixGen.Model.progressEventArgs progressArgs = (HelixGen.Model.progressEventArgs)e; // Update the various controls. try { // The code below is so the Navigation action is on the // thread of the GUI. Application.Current.Dispatcher.Invoke((Action) delegate { InitProgressBar.Value = (double)(progressArgs.percentageComplete); ProgressMessage.Text = progressArgs.message; Console.WriteLine(string.Format("_model_initializationProgress: Got the message; {0}.\r\n", ProgressMessage.Text )); }); } catch (Exception ex) { Console.WriteLine(string.Format("_model_initializationProgress: Caught an exception; {0}.\r\n", ex.Message)); } }
private void TheModel_initializationProgress(object sender, EventArgs e) { // We're waiting for initialization to complete. HelixGen.Model.progressEventArgs progressArgs = (HelixGen.Model.progressEventArgs)e; // Update the various controls. try { if (progressArgs.completed) { NavFrame.LoadCompleted -= NavFrame_Startup_Navigated; NavFrame.LoadCompleted += NavFrame_LoadCompleted; // The code below is so the Navigation action is on the // thread of the GUI. Application.Current.Dispatcher.Invoke((Action) delegate { _mainPage = new MainPage(this); // NavFrame.Navigate(_mainPage); showSetUpPage(); } ); } } catch (Exception ex) { Console.WriteLine(string.Format("TheModel_initializationProgress: Caught an exception; {0}.\r\n", ex.Message)); } }