开发者

Popup on inactivity Silverlight 2.0

开发者 https://www.devze.com 2022-12-29 00:53 出处:网络
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 sayi开发

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 sayi开发者_开发百科ng 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


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.!!

0

精彩评论

暂无评论...
验证码 换一张
取 消