Visual studio 在windows phone中检测屏幕何时关闭
有没有办法检测windows phone中的屏幕何时关闭?发生这种情况时,是否可以使应用程序运行?您应该将Visual studio 在windows phone中检测屏幕何时关闭,visual-studio,windows-phone-7,Visual Studio,Windows Phone 7,有没有办法检测windows phone中的屏幕何时关闭?发生这种情况时,是否可以使应用程序运行?您应该将applicationidledeccectionmode设置为启用,并处理根帧的模糊事件和无障碍事件: Microsoft.Phone.Shell.PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Enabled; var rootFrame = App.Curren
applicationidledeccectionmode
设置为启用,并处理根帧的模糊事件和无障碍事件:
Microsoft.Phone.Shell.PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Enabled;
var rootFrame = App.Current.RootVisual as PhoneApplicationFrame;
if(rootFrame != null)
{
rootFrame.Obscured += new EventHandler<ObscuredEventArgs>(rootFrame_Obscured);
rootFrame.Unobscured += new EventHandler(rootFrame_Unobscured);
}
Microsoft.Phone.Shell.PhoneApplicationService.Current.ApplicationIdleDetectionMode=IdleDetectionMode.Enabled;
var rootFrame=App.Current.RootVisual作为PhoneApplicationFrame;
if(rootFrame!=null)
{
rootFrame.obclused+=新的事件处理程序(rootFrame\u obclused);
rootFrame.Unobscured+=新的事件处理程序(rootFrame\u Unobscured);
}
查看更多信息您应该将applicationidledeccectionmode
设置为Enabled
,并处理根帧的obscribed
和unscribred
事件:
Microsoft.Phone.Shell.PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Enabled;
var rootFrame = App.Current.RootVisual as PhoneApplicationFrame;
if(rootFrame != null)
{
rootFrame.Obscured += new EventHandler<ObscuredEventArgs>(rootFrame_Obscured);
rootFrame.Unobscured += new EventHandler(rootFrame_Unobscured);
}
Microsoft.Phone.Shell.PhoneApplicationService.Current.ApplicationIdleDetectionMode=IdleDetectionMode.Enabled;
var rootFrame=App.Current.RootVisual作为PhoneApplicationFrame;
if(rootFrame!=null)
{
rootFrame.obclused+=新的事件处理程序(rootFrame\u obclused);
rootFrame.Unobscured+=新的事件处理程序(rootFrame\u Unobscured);
}
进一步了解这一点最好包含重要的代码示例,以供将来参考。当有人读到你的答案时,链接可能会消失,或者是404。@ClausJørgensen谢谢你的评论,我总是想让我的答案更有用)最好包含重要的代码示例,以供将来参考。当有人读到你的答案时,链接可能会消失,或者被404删除。@ClausJørgensen谢谢你的评论,我总是想让我的答案更有用)