示例#1
0
        private static async Task ShowInformationDialogAsync(InformationMessage message)
        {
            if (message is ExceptionMessage)
            {
                Trace.TraceError($"Exception: { message.VM.Details }");
            }

            var window = new InformationWindow()
            {
                VM = message.VM
            };

            await window.ShowDialog(MainWindow);

            message.Process();
        }
示例#2
0
        private static void ShowInformation(InformationMessage message)
        {
            InformationWindow window = new InformationWindow
            {
                DataContext = message.InformationVM
            };

            message.InformationVM.RequestClose += (sender, e) =>
            {
                window.Close();
            };
            window.Closed += (sender, args) =>
            {
                message.Process();
            };
            window.Show();
        }
示例#3
0
 private static void ShowInformation(InformationMessage message)
 {
     try
     {
         InformationWindow window = new InformationWindow
         {
             DataContext = message.InformationVM,
             Owner       = Application.Current.MainWindow,
         };
         message.InformationVM.RequestClose += (sender, e) =>
         {
             window.Close();
         };
         window.Closed += (sender, args) =>
         {
             message.Process();
         };
         window.Show();
     }
     catch (Exception ex)
     {
         ExceptionUtils.HandleException(ex);
     }
 }