public static void ShowError(this Exception ex) { ErrorWindow c = new ErrorWindow(ex); var root = Application.Current.RootVisual as FrameworkElement; c.Width = root.ActualWidth * 0.98; c.Height = root.ActualHeight * 0.98; c.HorizontalAlignment = HorizontalAlignment.Center; c.VerticalAlignment = VerticalAlignment.Center; c.Show(); }
private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) { e.Handled = true; ChildWindow errorWin = new ErrorWindow(e.ExceptionObject); var root = Application.Current.RootVisual as FrameworkElement; errorWin.Width = root.ActualWidth * 0.95; errorWin.Height = root.ActualHeight * 0.95; errorWin.HorizontalAlignment = HorizontalAlignment.Center; errorWin.VerticalAlignment = VerticalAlignment.Center; errorWin.Show(); }
public static void ShowError(this Exception ex) { ErrorWindow error = new ErrorWindow(ex); error.Show(); }
// If an error occurs during navigation, show an error window private void ContentFrame_NavigationFailed(object sender, NavigationFailedEventArgs e) { e.Handled = true; ChildWindow errorWin = new ErrorWindow(e.Uri); errorWin.Show(); }