We're adding a security feature to an application that makes it "time out" in a given number of minutes, kicking the user out if they are inactive for that long. Making the timer and displaying it, etc. was all very easy as you might expect.
I then get to the part where any action on the application should reset the timer, and I can't seem to find a clean/simple way to hook into the "event pipeline" and respond to all user interaction by resetting the timer. I figured there would be somewhere/some way to do that, but so far my research has turned up nothing.
I was basically hoping for something along these lines:
Dispatcher.EventHandling += delegate (object e)
{
//assuming this were to come before the event went anywhere from its source
((RoutedEventArgs)e).Handled = false;
MyTimeSpan = TimeSpan.Zero;
};
(I realize that this code doesn't check for the specific type of event, but it gets the point across)
This is not the same as the question that it was marked as duplicate of - while the answer was applicable here, the question is totally different and did not show up in searches/etc. when trying to find the answer to this question.