Share via


Click, Click and Click again in Silverlight 5! Check out FREE 30 day Azure pass!

So you want to be about to count your clicks, you can now in Silverlight 5!  This means that for old people who I know always do that double click thing, so now you can make stuff just for them. 

Someone beat me to doing a short video, below, nice job!

With just a few lines of code you got the clicking counting thingie!

The process uses the time between clicks, so if you wait too long then it resets. 

Your code can be as simple as:

 private void ClickMe_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{     System.Diagnostics.Debug.WriteLine("Click Count: " + e.ClickCount);     if (e.ClickCount == 2)        MessageBox.Show("Double Click!");
 
}
 Oh, and if you haven’t already, make sure to sign up up for the Azure 30 day pass, requires no credit card.  Check it out.  
 Especially if you are between jobs, employers are looking for Sharepoint and Azure.