public YesNoDialog(YesNoDialogLogic logic) { this.DataContext = logic; // Tell the logic how to close this dialog logic.CloseView = result => DialogResult = result; InitializeComponent(); }
public YesNoDialog(YesNoDialogLogic logic) { logic.CloseView = result => DialogResult = result == true ? DialogResult.OK : DialogResult.Cancel; InitializeComponent(); Text = logic.Title; labelString.Text = logic.Question; buttonOK.Text = logic.LeftButtonText; buttonCancel.Text = logic.RightButtonText; }