I have two WPF windows. The first (Window1) has a timer that moves an item down a list, then passes the new current selection to a global variable I defined in App.xaml.cs
Window 2 then has another timer that is set to .1 of a second after the timer in Window 1, and it uses this to grab the new current selection.
This works. Mostly. Because there is a delay between when Window 1 timer starts and when Window 2 timer starts, the two timers eventually go out of sync over a long period of time and bad things start happening with my code.
What I would like to do, is when I show Window 2, is to somehow 'reset' whatever value the Window 1 timer is at. This will not solve the problem, since the Window 1 timer is always smaller than the Window 2 timer, however, because the difference between them is so minute (0.001 seconds), the amount of time it would take for the timers to go too badly out of sync with each other would make it an acceptable solution.
The only issue is this strikes me as a really patchwork solution. But I can't see any other solution. If I were somehow able to create an event in App.xaml.cs that my two windows could use to see if the global variable changed, that would be ideal, but I don't think that's possible.
So does anyone know how I might reset the value of a timer?