Beispiel #1
0
        public static async Task <MessageBoxResult> ShowDialogAsync(string message, string caption, MessageBoxButton button = MessageBoxButton.OK, MessageBoxImage image = MessageBoxImage.None)
        {
            var model = new GenericDialogModel(message, caption, button, image);

            await ShowDialogAsync(model);

            return(model.Result);
        }
Beispiel #2
0
        public static async Task <MessageBoxResult> ShowDialogAsync(string message, MessageBoxButton button = MessageBoxButton.OK, MessageBoxImage image = MessageBoxImage.None)
        {
            var process = Process.GetCurrentProcess();

            var model = new GenericDialogModel(message, process.ProcessName, button, image);

            await ShowDialogAsync(model);

            return(model.Result);
        }
Beispiel #3
0
        public static async Task ShowExceptionMessage(Exception exception)
        {
            var process       = Process.GetCurrentProcess();
            var stringBuilder = new StringBuilder();

            stringBuilder.AppendLine("Unhandled Error:");
            stringBuilder.AppendLine();
            stringBuilder.AppendLine(exception.Message);

            var model = new GenericDialogModel(stringBuilder.ToString(), process.ProcessName, MessageBoxButton.OK, MessageBoxImage.Error);

            await ShowDialogAsync(model);
        }