I have a checkbox. On this checked event, I want to disable IdleDetectionMode and on the unverified event that I want to turn on. This is the code: -
private void chkRunInBackground_Checked(object sender, RoutedEventArgs e) { PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled; } private void chkRunInBackground_Unchecked(object sender, RoutedEventArgs e) { PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Enabled; }
The checked event works fine, but with the unchecked event that I receive, the IdleDetection mode cannot be fired after it is disabled. Why does this restriction apply and what can I do to get around it?
source share