public MessageBoxWindowViewModel(MessageBoxButton button, string warnWords, string titleWords) { if (button == MessageBoxButton.OKCancel || button == MessageBoxButton.OK) { AddButton(MessageButtonModel.CreateOKBtn(), ConfirmCommand); if (button == MessageBoxButton.OKCancel) { AddButton(MessageButtonModel.CreateCancelBtn(), DenyCommand); } } else if (button == MessageBoxButton.YesNo || button == MessageBoxButton.YesNoCancel) { AddButton(MessageButtonModel.CreateYESBtn(), ConfirmCommand); AddButton(MessageButtonModel.CreateNOBtn(), DenyCommand); if (button == MessageBoxButton.YesNoCancel) { AddButton(MessageButtonModel.CreateCancelBtn(), EmptyCommand); } } this.WarnWords = warnWords; this.TitleWords = titleWords; }
private void AddButton(MessageButtonModel btnModel, DelegateCommand command) { btnModel.Command = command; Buttons.Add(btnModel); }