private static Window CreateWindow(Exception exception, string applicationName, string email)
        {
            var window = new Window
            {
                Title = string.IsNullOrEmpty(applicationName)
                        ? "Unexpected Error"
                        : Invariant($"Unexpected Error in {applicationName}"),
                Width    = 640,
                Height   = 480,
                MinWidth = 410,
            };
            var control = new ExceptionControl
            {
                ApplicationName = applicationName,
                Exception       = exception,
                Email           = email,
            };

            window.Content = control;
            control.Close += (s, e) => window.Close();
            window.Closed += (s, e) => Logger.Debug("Exception window closed.");
            return(window);
        }
Exemple #2
0
 private static Window CreateWindow(Exception exception, string applicationName, string email)
 {
     var window = new Window
     {
         Title = string.IsNullOrEmpty(applicationName)
                 ? "Unexpected Error"
                 : Invariant($"Unexpected Error in {applicationName}"),
         Width = 640,
         Height = 480,
         MinWidth = 410,
     };
     var control = new ExceptionControl
     {
         ApplicationName = applicationName,
         Exception = exception,
         Email = email,
     };
     window.Content = control;
     control.Close += (s, e) => window.Close();
     window.Closed += (s, e) => Logger.Debug("Exception window closed.");
     return window;
 }