/// <summary> /// Initializes a new instance of the <see cref="OperationFailedView" /> /// </summary> /// <param name="viewModel">The view-model of the view</param> public OperationFailedView(OperationFailedViewModel viewModel) { InitializeComponent(); DataContext = viewModel; viewModel.CloseView += (s, e) => Close(); }
/// <summary> /// Display the dialog informing about faulure during the operation and confirmation to repeat or cancel the operation. /// </summary> /// <param name="operationName">The name of the operation.</param> /// <param name="actionResult">The result of the confirmation.</param> /// <returns></returns> protected static OperationFailedViewModel DisplayOperationFailedDialog(string operationName, IActionResult actionResult) { var operationFailedViewModel = new OperationFailedViewModel(operationName, actionResult); new OperationFailedView(operationFailedViewModel).ShowDialog(); return operationFailedViewModel; }