Reputation: 90
I have an WPF-Application with 3 different UserControls in the MainWindow and only one of these is visible at the time. It's like having 3 different pages and you able to switch from one page to another when you like it. First page is like a start-screen. Second is like the "general view". And the third page shows details. Switching between them works fine with Storyboard. I just make the visible page invisible (opacity to zero) and move it out of the visible window- area and move the new page into the visible window-area and make it visible. So far so good... (Hope you understood what I wanted to tell^^)
But it would be nice to have something like a screensaver-mode. What I want is: When a user does nothing for , lets says, 2 minutes, then the Storyboard should be run that brings you back to the startscreen-view.
How would this work??
Upvotes: 0
Views: 694
Reputation: 2015
You can use DispatcherTimer to track the Application Idle time. Start this timer whenever you are in the screens except StartScreen. Reset the timer to zero whenever the window have mouse events. Set Timer duration to 2 mins, so that on timer callback make the startscreen visible.
Upvotes: 1