Reputation: 2763
In my application I need to know when device is locked. How to detect when the screen is locked, also when unlocked.
Upvotes: 0
Views: 163
Reputation: 9250
You can use Obscured/Unobscured events. But there are some limitations:
This event is raised when the lock screen is engaged or when some other action obscures the running application’s frame, such as an incoming phone call.
Upvotes: 1
Reputation: 1660
public App()
{
RootFrame.Obscured += Obscured;
RootFrame.Unobscured += Unobscured;
}
Upvotes: 1