Answered by:
Is application active ?

Question
-
How can i detect if application is currently active (on top) or running in background ?Tuesday, September 11, 2012 8:34 AM
Answers
-
CoreWindow.Visible property
http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.core.corewindow.visible.aspx
to observe changes listen to VisibilityChanged
Xaml maps Visible into Window.Visible
- Proposed as answer by Jesse Jiang Tuesday, September 18, 2012 5:56 AM
- Marked as answer by Petr Jurik - Ventis Media Tuesday, September 18, 2012 12:41 PM
Saturday, September 15, 2012 5:48 AM
All replies
-
What do you mean by the app being active? What scenario are you trying to enable?
You can watch CoreWindow.Activated to see when your host window is activated and deactivated.
Apps will suspend when they aren't being used and won't run any code. For key background scenarios they can move the processing to a background task.
--Rob
Tuesday, September 11, 2012 8:44 PMModerator -
My app is able to run in background and i need to show Toast only when my app is not 'on top' (active).Tuesday, September 11, 2012 8:59 PM
-
Anybody ?Friday, September 14, 2012 7:40 AM
-
CoreWindow.Visible property
http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.core.corewindow.visible.aspx
to observe changes listen to VisibilityChanged
Xaml maps Visible into Window.Visible
- Proposed as answer by Jesse Jiang Tuesday, September 18, 2012 5:56 AM
- Marked as answer by Petr Jurik - Ventis Media Tuesday, September 18, 2012 12:41 PM
Saturday, September 15, 2012 5:48 AM