none
windows phone 8.1 锁屏运行代码 RRS feed

  • 问题

  • 请问,8.1 sdk锁屏运行是哪个函数?

    PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled; 

    这个好像不行了

    2014年11月10日 6:44

答案

  • 你好,

    >>PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled; 这个好像不行了

    请参见MSDN文档- PhoneApplicationService Class: http://msdn.microsoft.com/library/windows/apps/microsoft.phone.shell.phoneapplicationservice

    Supported in: Windows Phone 8, Silverlight 8.1

    可见,如果你是开发 WP8.1 RT的应用,这种方式已经是不可以使用了。

    目前是还没有一个直接的可替代方案,只能是使用 DisplayRequest class 使应用保持唤醒:

    public MainPage()
    {
                this.InitializeComponent();
    
                this.NavigationCacheMode = NavigationCacheMode.Required;
    
                var displayRequest = new Windows.System.Display.DisplayRequest();
                displayRequest.RequestActive();
    
                BackgroundMediaPlayer.Current.IsLoopingEnabled = true;
                BackgroundMediaPlayer.Current.SetUriSource(new Uri("ms-appx:///Assets/test.mp3", UriKind.Absolute));
                BackgroundMediaPlayer.Current.Play();
    }

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2014年11月11日 6:57
    版主
  • 谢谢,我似乎也只有这样了。

    还有一个问题,请问在WP8.1 RT有API 能实现一键锁屏吗?


    目前据我所知是没有的,WP8上可以用这个帖子中的方法实现:https://social.msdn.microsoft.com/Forums/zh-CN/b181ffec-3a3f-4cf6-981e-4200f3b5c56b?forum=windowsphonezhchs

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2014年11月11日 7:14
    版主

全部回复

  • 你好,

    >>PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled; 这个好像不行了

    请参见MSDN文档- PhoneApplicationService Class: http://msdn.microsoft.com/library/windows/apps/microsoft.phone.shell.phoneapplicationservice

    Supported in: Windows Phone 8, Silverlight 8.1

    可见,如果你是开发 WP8.1 RT的应用,这种方式已经是不可以使用了。

    目前是还没有一个直接的可替代方案,只能是使用 DisplayRequest class 使应用保持唤醒:

    public MainPage()
    {
                this.InitializeComponent();
    
                this.NavigationCacheMode = NavigationCacheMode.Required;
    
                var displayRequest = new Windows.System.Display.DisplayRequest();
                displayRequest.RequestActive();
    
                BackgroundMediaPlayer.Current.IsLoopingEnabled = true;
                BackgroundMediaPlayer.Current.SetUriSource(new Uri("ms-appx:///Assets/test.mp3", UriKind.Absolute));
                BackgroundMediaPlayer.Current.Play();
    }

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2014年11月11日 6:57
    版主
  • 谢谢,我似乎也只有这样了。

    还有一个问题,请问在WP8.1 RT有API 能实现一键锁屏吗?

    2014年11月11日 7:01
  • 谢谢,我似乎也只有这样了。

    还有一个问题,请问在WP8.1 RT有API 能实现一键锁屏吗?


    目前据我所知是没有的,WP8上可以用这个帖子中的方法实现:https://social.msdn.microsoft.com/Forums/zh-CN/b181ffec-3a3f-4cf6-981e-4200f3b5c56b?forum=windowsphonezhchs

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2014年11月11日 7:14
    版主
  • 谢谢大神~~
    2014年11月11日 7:18
  • 谢谢大神~~

    不谢,互相学习:)

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2014年11月11日 7:23
    版主