Some times in App.xaml.cs file ,we may get an exception like "Null Exception was unhandled" at line
PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
So solutions are
Solution1:
Clearing the \bin and \obj folders and then recompile ,it will resolve your issue.
Solution2:
By adding PhoneApplicationService = new PhoneApplicationService() on the line above code.