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
Clearing the \bin and \obj folders and then recompile ,it will resolve your issue.
By adding PhoneApplicationService = new PhoneApplicationService() on the line above code.