Silverlight 2.0 Idle Popup

I have a silverlight 2.0 application and that is using WCF service to get data and validate etc. Is there a way to check if the silverlight app is inactive and then show the user a toast that there is no activity so you will be logged out and redirected to the login page? Please advise.

Also being able to have a submit timer and reset it on every page would be tedious since there are about 100 xaml pages, so I need to edit every xaml page to check for activity and then reset the timer. So there is another easier approach. Please suggest!

Thanks in advance Sai

+2


a source to share


1 answer


Sorry for updating this so late. Finally, I was able to find a solution for this.

In App.xaml, in the Startup method, we can attach MouseClick or mousemove or whatever to RootVisual, since all pages will be linked to RootVisual, create a variable to store the last activity time, so on the event (mousemove or click) update the lastActivityTime variable with a new value in App.xaml. Then add a dispatchtimer to App.xaml and check in regualr the time intervals if the current time minus lastActivityTime is greater than the threshold time if so log out.



Hope this helps. !!

0


a source







All Articles