i have a wpf app that is updating date/time in one dispatchertimer, another is for a mp3 player timer that tracks time and slidebar for playing time. is it possible to have 2 dispatchertimer’s running?
that’s dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
and dispatcherTimer.Tick += new EventHandler(mp3Timer_Tick);
Yes, it’s possible.
What you are doing is something different: You are trying to attach two event handlers to one DispatcherTimer. Don’t do that. If you want two timers for different purposes (and with different timeouts), use two DispatcherTimer objects:
Then you can do something like…
…when the music stops playing, and it won’t affect the
dateTimeTimer.