Why is a DispatcherTimer Tick event not occurring on time?
<p>I want to disable a button <em>-to prevent double click: On a tablet PC you push once, it clicked twice and this is the easiest hack that I know-</em> for a short period but I noticed/debugged the interval might be too long in practice; 50 ms vs > 2 seconds.</p>

<p>There is in only one line starts the timer and one line stops it. Randomly the interval is 50 ms or much bigger. There is no CPU consume, I just click the button with mouse on my 4 core desktop PC.</p>

<p>What would be the reason?</p>

<pre><code>    DispatcherTimer timerTouchDelay = new DispatcherTimer();

    protected override void OnMouseDown(MouseButtonEventArgs e)
    {
        //Init
        if (timerTouchDelay.Interval.Milliseconds == 0)
        {
            timerTouchDelay.Tick += new EventHandler(timerTouchDelay_Tick);
            timerTouchDelay.Interval = new TimeSpan(0, 0, 0, 0, 50); //ms

        }


        if(timerTouchDelay.IsEnabled)
            return;

        timerTouchDelay.Start();

        HandleKeyDown();
        base.OnMouseDown(e);
    }

    private void timerTouchDelay_Tick(object sender, EventArgs e)
    {
        timerTouchDelay.Stop();
    }
</code></pre>
