0
Windows 전화에서 화면이 꺼지면 감지 할 수있는 방법이 있습니까? 이런 일이 발생하면 응용 프로그램을 실행할 수 있습니까?Windows에서 화면이 꺼질 때 감지
Windows 전화에서 화면이 꺼지면 감지 할 수있는 방법이 있습니까? 이런 일이 발생하면 응용 프로그램을 실행할 수 있습니까?Windows에서 화면이 꺼질 때 감지
당신은 Enabled
에 ApplicationIdleDecectionMode
을 설정하고 루트 프레임의 Obscured
및 Unobscured
이벤트를 처리해야합니다
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);
}
그것은 미래의 참조에 대한 중요한 코드 샘플을 포함하는 좋은 습관이다이
article
더 봐. 링크가 죽을 수도 있고 다른 사람이 답을 읽을 때 404'd가 될 수도 있습니다. –
@ ClausJørgensen이 의견을 보내 주셔서 감사합니다. 항상 제 답변을 더 유용하게 만들고 싶습니다.) –