Launch the Windows Phone 8.1 RT app under a locked screen

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?

+4
1

RT Windows Phone 8.1 PhoneApplicationService ( Silverlight Windows Phone 8.1).

, , DisplayRequest.

OLD

PhoneApplicationService, , - Windows Phone 8.1.

, , Windows 8.1, Windows Phone 8.1.

, :

#if WINDOWS_PHONE_APP

PhoneApplicationService.Current.ApplicationIdleDetectionMode = 
    IdleDetectionMode.Disabled;
// etc.

#endif

, Universal Applications :

Universal Windows ( )

+1

Source: https://habr.com/ru/post/1538446/


All Articles