public CountdownButton()
 {
     AskBehavior = new AskBehavior(this);
     State = new NormalState(this);
     Timer = new DispatcherTimer(DispatcherPriority.Normal, Dispatcher);
     Timer.Interval = TimeSpan.FromSeconds(1);
     Timer.Tick += (sender, e) =>
     {
         if (State is CountDownState == false)
         {
             return;
         }
         Count -= 1;
         if (Count > 0)
         {
             Content = CountdownMessage;
             return;
         }
         Content = text;
         Timer.Stop();
         base.OnClick();
         State = new NormalState(this);
     };
 }
Esempio n. 2
0
 public AskButton()
 {
     AskBehavior = new AskBehavior(this);
     AddBehavior(AskBehavior.OnClick);
 }