Skip to content

Instantly share code, notes, and snippets.

@LambdaSix
Created January 22, 2013 16:22
Show Gist options
  • Save LambdaSix/4595995 to your computer and use it in GitHub Desktop.
Save LambdaSix/4595995 to your computer and use it in GitHub Desktop.
To prevent ListPicker from raising BackKeyPress on your views. Otherwise, navigating back from a listpicker full screen mode will raise the key back event as if the page had actually gone back. This is probably true for any other controls that open something to fill the screen (LongListSelector, etc)
RootFrame.BackKeyPress += (o, args) =>
{
if (o is PhoneApplicationFrame)
{
var j = o as PhoneApplicationFrame;
var listPicker = "/Microsoft.Phone.Controls.Toolkit;component/ListPicker/ListPickerPage.xaml";
if (j.Source.OriginalString == listPicker)
{
return;
}
}
WizardManager.Instance.Decrement();
Debug.WriteLine("Notifying WizardManager of BackEvent");
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment