protected void ShowMessage(string message, string title) { if (View != null) { SharedBaseView.ShowOkOnkyMessageBox(View, message, title); } }
protected void ShowErrorMessage(string message) { if (View != null) { SharedBaseView.ShowErrorMessageBox(View, message); } }
private void ApplicationStart(object sender, StartupEventArgs e) { try { AppDomain.CurrentDomain.UnhandledException += OnUnhandledException; Current.ShutdownMode = ShutdownMode.OnExplicitShutdown; Settings = AppSettings.Initialize(); if (Settings != null) { var splash = new SplashScreenView(); if ((bool)splash.ShowDialog()) { RepositoryWrapper.Instantiate(Settings.CurrentConnectionString); var mainWindow = new MainWindow(); Current.ShutdownMode = ShutdownMode.OnMainWindowClose; Current.MainWindow = mainWindow; MainWindow.Show(); } else { Current.Shutdown(0); } } else { throw new ArgumentNullException("No se pudo leer el archivo de configuración."); } } catch (Exception ex) { SharedBaseView.ShowErrorMessageBox(new WaitingView(""), ex.Message); Current.Shutdown(-1); } }
protected bool ShowYesNoMessageBox(string message, string title) { if (View != null) { return(SharedBaseView.ShowYesNoMessageBox(View, message, title)); } return(false); }
public void SaveImage(string filename) { var imageFilename = SharedBaseView.SaveFileDialog("Imagenes *.png|*.png", "Guardar imagen", filename); if (!string.IsNullOrEmpty(imageFilename)) { SharedBaseView.CaptureScreen(imageFilename, MainChart, 200, 200); } }
private void OnUnhandledException(object sender, UnhandledExceptionEventArgs e) { if (e.IsTerminating) { SharedBaseView.ShowErrorMessageBox(new WaitingView(""), "Application will shut down because irrecoverable error. More info: " + e.ExceptionObject.ToString()); } else { SharedBaseView.ShowErrorMessageBox(new WaitingView(""), e.ExceptionObject.ToString()); } ExceptionHandler.Log(e.ExceptionObject.ToString(), TraceEventType.Critical, "Unhandled Exception"); }
private void AfterContentRendered(object sender, EventArgs e) { Task.Run(() => { try { ShowWaitingMessage("Abriendo la base de datos"); CreateViewModelsForPanels(); } catch (Exception ex) { ExceptionHandler.Handle(ex, false); SharedBaseView.ShowErrorMessageBox((Window)this, ex.Message); } finally { CloseWaitingMessage(); } }); }