2

As the title specifies, I want to know if any events will happen before the screen gets locked in Windows Phone 7, so that before the screen got locked I can use some combined conditions to determine setting the IdleDetectionMode to Disabled or not.

Or can we get the system screen locking time?

Keith Thompson
  • 254,901
  • 44
  • 429
  • 631
ellic
  • 798
  • 12
  • 28
  • Before, not that I know of, there is obviously the 'Deactivated' event, have you tried using that? http://msdn.microsoft.com/en-us/library/microsoft.phone.shell.phoneapplicationservice.deactivated(v=vs.92).aspx – Darren Reid Oct 30 '12 at 03:27
  • @Layoric Thanks, Layoric. But actually the Deactivated wouldn't happand before the screen got locked. – ellic Oct 30 '12 at 03:29
  • correct, not exactly sure of your requirements, so I thought I'd suggest it. I don't believe there is such an event. – Darren Reid Oct 30 '12 at 03:42

1 Answers1

2

I think you should try using Obscured(Occurs when the shell chrome is covering the frame) and Unobscured(Occurs when the shell chrome is no longer covering the frame) events for PhoneApplicationFrame.

You can always get the instance of PhoneApplicationFrame using (PhoneApplicationFrame)App.Current.RootVisual, but be careful and do not create memory leaks.

Jevgeni Tsaikin
  • 321
  • 1
  • 5