Exemplo n.º 1
0
        public static T OpenDialog <T>(BaseDialogViewModel <T> viewModel)
        {
            IDialogWindow window = new BaseDialogWindow();

            window.DataContext = viewModel;
            window.ShowDialog();
            return(viewModel.DialogResult);
        }
Exemplo n.º 2
0
        public void ShowAboutWindow()
        {
            var baseDialogViewModel = new BaseDialogViewModel(Properties.strings.About);
            var aboutViewModel      = new AboutViewModel(Properties.strings.About);

            baseDialogViewModel.CurrentViewModel = aboutViewModel;
            var baseDialog = new BaseDialogWindow {
                DataContext = baseDialogViewModel
            };

            aboutViewModel.CloseRequest += baseDialog.OnCloseDialog;
            var result = baseDialog.ShowDialog();
        }
        public void ShowError(Exception exception, string message, string title = "")
        {
            var exceptionViewer  = new ExceptionViewer(message, exception);
            var baseDialogWindow = new BaseDialogWindow
            {
                Title   = string.IsNullOrEmpty(title) ? "Error" : title,
                Content = exceptionViewer,
                WindowStartupLocation = WindowStartupLocation.CenterScreen,
                ResizeMode            = ResizeMode.NoResize,
                IsMinButtonEnabled    = false
            };

            baseDialogWindow.ShowDialog();
        }
Exemplo n.º 4
0
        public void ShowSettingsWindow()
        {
            var baseDialogViewModel = new BaseDialogViewModel(Properties.strings.Settings);
            var settingsViewModel   = new SettingsViewModel(Properties.strings.Settings);

            baseDialogViewModel.CurrentViewModel = settingsViewModel;
            var baseDialog = new BaseDialogWindow {
                DataContext = baseDialogViewModel
            };

            settingsViewModel.DialogResultFalseRequest += baseDialog.OnDialogResultFalse;
            settingsViewModel.DialogResultTrueRequest  += baseDialog.OnDialogResultTrue;
            var result = baseDialog.ShowDialog();
        }
Exemplo n.º 5
0
        public void ShowReportErrorWindow()
        {
            var baseDialogViewModel  = new BaseDialogViewModel(Properties.strings.ReportError);
            var reportErrorViewModel = new ReportErrorViewModel(Properties.strings.ReportError);

            baseDialogViewModel.CurrentViewModel = reportErrorViewModel;
            var baseDialog = new BaseDialogWindow {
                DataContext = baseDialogViewModel
            };

            reportErrorViewModel.DialogResultFalseRequest += baseDialog.OnDialogResultFalse;
            reportErrorViewModel.DialogResultTrueRequest  += baseDialog.OnDialogResultTrue;
            var result = baseDialog.ShowDialog();
        }
        public void ShowError(Exception exception, string message, string title = "")
        {
            var exceptionViewer  = new ExceptionViewer(message, exception);
            var baseDialogWindow = new BaseDialogWindow
            {
                Title   = string.IsNullOrEmpty(title) ? "Error" : title,
                Content = exceptionViewer,
                WindowStartupLocation = WindowStartupLocation.CenterScreen,
                ResizeMode            = ResizeMode.CanResizeWithGrip,
                MinHeight             = 400,
                MinWidth             = 500,
                ShowMinButton        = false,
                ShowMaxRestoreButton = false
            };

            baseDialogWindow.ShowDialog();
        }
Exemplo n.º 7
0
        public static void ShowError(Exception exception, string message, string caption = "")
        {
            var exceptionViewer  = new ExceptionViewer(message, exception);
            var baseDialogWindow = new BaseDialogWindow
            {
                Title   = string.IsNullOrEmpty(caption) ? "Error" : caption,
                Content = exceptionViewer,
                WindowStartupLocation = WindowStartupLocation.CenterScreen,
                ResizeMode            = ResizeMode.CanResizeWithGrip,
                MinHeight             = 400,
                MinWidth             = 500,
                ShowMinButton        = false,
                ShowMaxRestoreButton = false,
                ShowInTaskbar        = false
            };

            baseDialogWindow.ShowDialog();

            // MessageBox.Show(message, caption, MessageBoxButton.OK, MessageBoxImage.Error);
        }
Exemplo n.º 8
0
        public void ShowError(Exception exception, string message, string caption = "")
        {
            if (_errorNotified)
            {
                return;
            }

            _errorNotified = true;

            var exceptionViewer  = new ExceptionViewer(message, exception);
            var baseDialogWindow = new BaseDialogWindow
            {
                Title   = string.IsNullOrEmpty(caption) ? "Error" : caption,
                Content = exceptionViewer,
                WindowStartupLocation = WindowStartupLocation.CenterScreen,
                ResizeMode            = ResizeMode.NoResize,
                IsMinButtonEnabled    = false
            };

            baseDialogWindow.ShowDialog();

            // MessageBox.Show(message, caption, MessageBoxButton.OK, MessageBoxImage.Error);
        }