19 November, 2010

WP7: How to disable the lockscreen

If you want to prevent the lockscreen from appearing, set this in App.xaml.cs:

public partial class App : Application

// Easy access to the root frame
public PhoneApplicationFrame RootFrame { get; private set; }

// Constructor
public App()
// Global handler for uncaught exceptions.
// Note that exceptions thrown by ApplicationBarItem.Click will not get caught here.
UnhandledException += Application_UnhandledException;

// Standard Silverlight initialization

// Phone-specific initialization

PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;

It’s actually not that difficult – it goes like this

  1. Select the app.xaml file
  2. RightClick the file/or press F7
  3. Enter this line in the contructor:

Technorati Tags:


J said...

A step by step guide would be great.

J said...

A step by step guide would be great.

iPhone/XCode - not all cases are equal!

This bit me! Having made some changes to an iPhone application (Obj-C); everything worked fine in the simulator. But, when deploying the s...