Пример #1
0
		static MessageBoxResult ShowWindow(string title, string message, MessageBoxButton messageBoxButton, MessageBoxImage messageBoxImage, bool isException = false, bool isModal = true)
		{
			var viewModel = new MessageBoxViewModel(title, message, messageBoxButton, messageBoxImage, isException);
			if (_messageBoxHandler == null)
				Show(viewModel, isModal);
			else
				_messageBoxHandler(viewModel, isModal);
			return viewModel.Result;
		}
Пример #2
0
		void MessageBoxHandler(MessageBoxViewModel viewModel, bool isModal)
		{
			_dispatcher.Invoke((Action)(() =>
			{
				var startupMessageBoxViewModel = new ServerMessageBoxViewModel(viewModel.Title, viewModel.Message, viewModel.MessageBoxButton, viewModel.MessageBoxImage, viewModel.IsException);
				if (isModal)
					DialogService.ShowModalWindow(startupMessageBoxViewModel);
				else
					DialogService.ShowWindow(startupMessageBoxViewModel);
				viewModel.Result = startupMessageBoxViewModel.Result;
			}));
		}
Пример #3
0
		static void Show(MessageBoxViewModel viewModel, bool isModal = true)
		{
			if (isModal)
				DialogService.ShowModalWindow(viewModel);
			else
				DialogService.ShowWindow(viewModel);
		}
Пример #4
0
 private static MessageBoxResult ShowWindow(string title, string message, MessageBoxButton messageBoxButton, MessageBoxImage messageBoxImage, bool isException = false)
 {
     var viewModel = new MessageBoxViewModel(title, message, messageBoxButton, messageBoxImage, isException);
     Show(viewModel);
     return viewModel.Result;
 }
Пример #5
0
 public static void Show(MessageBoxViewModel viewModel)
 {
     DialogService.ShowModalWindow(viewModel);
 }
Пример #6
0
		public static void Show(MessageBoxViewModel viewModel)
		{
			viewModel.TopMost = true;
			DialogService.ShowModalWindow(viewModel);
		}