Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

wpf, DispatcherTimer Example?

$
0
0

Given:

    //Global descriptor
    System.Timers.Timer gTimerFlag = new System.Timers.Timer();

    //------------------------------
    private void SetTimerInterrupts()
    {
      gTimerFlag.Enabled = false;
      gTimerFlag.Interval = 500 * g.TIME_1_MSEC;
      gTimerFlag.Elapsed += new System.Timers.ElapsedEventHandler(TimerFlag_Elapsed);
      gTimerFlag.SynchronizingObject = this;
      ...
    }//SetTimerInterrupts
    //------------------------------
    //------------------------------
    private void TimerFlag_Elapsed(object source, ElapsedEventArgs e)
    {
      ...
    }//TimerFlag_Elapsed
    //------------------------------

Note the timer is enabled in a different section of code.  What is the correct nomenclature for changing this to a DispatcherTimer?



cte677



Viewing all articles
Browse latest Browse all 18858

Trending Articles