public MyMasterMindViewModel(MasterMindBoard masterMindBoard, MasterMindCommands masterMindCommands) { MasterMindBoard = masterMindBoard; ((ISetCheckCheckCommandEventHandler)MasterMindBoard).SetCheckCheckCommandEventHandler(CheckCheckCommand); MasterMindCommands = masterMindCommands; // bind commands to buttons MasterMindCommands.SetCommandEventHandler(MyMasterMindCommands.Clear, ClearCommand); MasterMindCommands.SetCommandEventHandler(MyMasterMindCommands.ComputerSlow, ComputerSlowCommand); MasterMindCommands.SetCommandEventHandler(MyMasterMindCommands.ComputerFast, ComputerFastCommand); MasterMindCommands.SetCommandEventHandler(MyMasterMindCommands.Cancel, CancelCommand); MasterMindCommands.SetCommandEventHandler(MyMasterMindCommands.User, UserCommand); MasterMindCommands.SetCommandEventHandler(MyMasterMindCommands.Check, CheckCommand); DisableCommands(new List <MyMasterMindCommands>() { MyMasterMindCommands.Check, MyMasterMindCommands.Cancel }); }
public ButtonCommand(IMasterMindCommandView masterMindCommandView, MyMasterMindCommands command) { MasterMindCommandView = masterMindCommandView; Command = command; }