Question

I have silverlight 2.0 application and which uses WCF service to get data and validate ser etc. Is there any option to check inactivity on silverlight app and then show a popup message to user saying that there is no activity going on so you will be logged out and redirect page to login page? Please advise.

Also the option of having dispatch timer and resetting it on every page would be tedious as there are around 100 xaml pages so I need to edit every xaml page in order to check the activity and then reset the timer. So is there is any other simpler approach. Please suggest!

Thanks in advance Sai

Was it helpful?

Solution

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

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

Hope this helps.!!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top