Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
 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); });
 }