public async void Count() { for (long i = 5; i > 0; i--) { lbltxt = i.ToString(); if (click == true) { break; } if (i == 1) { GridBackround = ""; } await Task.Run(() => { Thread.Sleep(1000); }); } click = true; RightCommand.RaiseCanExecuteChanged(); WrongCommand.RaiseCanExecuteChanged(); }
public ViewModel() { Count(); RightCommand = new DelegateCommand(() => { GridBackround = "green"; click = true; RightCommand.RaiseCanExecuteChanged(); WrongCommand.RaiseCanExecuteChanged(); }, () => { return(!click); }); WrongCommand = new DelegateCommand(() => { GridBackround = ""; click = true; WrongCommand.RaiseCanExecuteChanged(); RightCommand.RaiseCanExecuteChanged(); }, () => { return(!click); }); }