Auto Logout on user inactivity

Topics: UI Architecture
Jul 24, 2013 at 8:29 AM
In my Silverlight App I need an auto logout on userinactivity. I tried the solution with mouse move event in the shell view model:
private void StartAutoLogoutTimer()
      {
         Timer = DateTime.Now;
         _Logouttimer.Tick += _Logouttimer_Tick;
         _Logouttimer.Interval = TimeSpan.FromSeconds( 60 );
         _Logouttimer.Start();
      }

      private void StopAutoLogoutTimer()
      {
         _Logouttimer.Stop();
         _Logouttimer.Tick -= _Logouttimer_Tick;
      }

      private void _Logouttimer_Tick( object sender, EventArgs e )
      {
         try
         {
            if ( ( System.DateTime.Now - Timer ) > new TimeSpan( 0, 10, 0 ) )
            {
               Logout();
            }
         }
         catch ( Exception ex )
         {

         }
      }

      public void OnMouseMove()
      {
         Timer = DateTime.Now;
      }
The problem is that I do not get mouse move events when child windows (dialogs) are opened because only the Shell has implemented the mouse move event - and I really do not want to implement the mouse move event in each dialog/window. Somebody has a hint/example of how this can be done? Perhaps not using mouse move event?