I got a little problem with button events. I programmed one button to decrease specific value by 1 (click), and I want to decrease it over time while holding button pressed. I’m using Silverlight, not XNA.
myTimer.Change(0, 100);
private void OnMyTimerDone(object state)
{
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
if (rightButton.IsPressed)
{
rightButton_Click(null, null);
}
});
}
this code is correctly working at the beginning, but then I am unable to single tap as it is always calling hold event.
Try to use the RepeatButton silverlight control instead of using a normal Button
Here is an Example of how to use it:
XAML Code:
C# Code: