public void ConfirmActionCommandExecute_ActionWasPassedInTheConstructor_ExecutesThatAction() { bool actionExecuted = false; Action actionToExecute = () => actionExecuted = true; var sut = new ConfirmActionViewModel(actionToExecute, "some Warning Message"); sut.ConfirmActionCommand.Execute(null); Assert.That(actionExecuted, Is.True); }
static void HandleUserConfirmActionEvent(UserConfirmActionEventArgs userConfirmActionEventArgs) { var viewModel = new ConfirmActionViewModel( userConfirmActionEventArgs.ActionToConfirm, userConfirmActionEventArgs.Message); var userConfirmActionView = new ConfirmActionView(viewModel) { Owner = Application.Current.MainWindow }; userConfirmActionView.ShowDialog(); }
public ConfirmActionView(ConfirmActionViewModel viewModel) : this() { DataContext = viewModel; }