title: How to temporarily disable button after click in Xamarin Forms?
body: <p>I am making a poll application in <code>Xamarin Forms</code> and I want users to be able to vote just one time/day. On the UI page, I created an ImageButton and I want the user to be able to click it just one time/day. I tried using a Timer, and tried to test it for 5 seconds intervals. The Application disabled the button when I first clicked it but after 5 seconds I could click it all over again and it doesn't disable the button. </p>
  
  <pre><code>private void ImageButton_Clicked(object sender, EventArgs e)
  {
     this.IsEnabled = false;
     Timer aTimer = new Timer();
     aTimer.Interval = 5000; //ms
     aTimer.Enabled = true;
     aTimer.Elapsed += ATimer_Elapsed;
  }
  
  private void ATimer_Elapsed(object sender, ElapsedEventArgs e)
  {
    this.IsEnabled = true;       
  }
  </code></pre>
  
  <p>I saw that the application enters the <code>ImageButton_Clicked</code> function all the time but it does not execute <code>this.IsEnabled=false</code>;</p>