How can I make the Windows Phone 8.1 application work under a locked screen, as I can in Windows Phone 8, using the following code:
PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled;
PhoneApplicationFrame rootFrame = App.Current.RootVisual as PhoneApplicationFrame;
if (rootFrame != null)
{
rootFrame.Obscured += new EventHandler<ObscuredEventArgs>(rootFrame_Obscured);
rootFrame.Unobscured += new EventHandler(rootFrame_Unobscured);
}
I am working on a Windows Phone 8.1 application (storage), because it is not a Silverlight type, so for starters it seems that PhoneApplicationService is not part of this API, so the above code will not work. Does anyone have an idea of what the recommended way to do this in Windows Phone 8.1?
PS. If this is not possible, as I am beginning to fear, then what are my alternatives?