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
InitializeComponent();

// Phone-specific initialization
InitializePhoneApplication();


PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
}

Update:
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:
    image


Technorati Tags:

2 comments:

Jason Williams said...

A step by step guide would be great.

Jason Williams said...

A step by step guide would be great.