1

My app is being rejected from the Marketplace because of requirement 5.2.4.c (back button must close menu or dialog and cancel back navigation). I'm using a ListPicker from the Silverlight Toolkit and that's what's causing the failure: pressing the back button when the ListPicker is open goes back instead of closing the ListPicker and cancelling back navigation.

This seems simple enough to fix: if the user presses the back button and the ListPicker is open, I close it and cancel back navigation. However, I haven't seen a way of programatically either detecting whether a ListPicker is open, or closing a ListPicker.

Am I missing something? How could I fix this bug?

2 Answers 2

3

One again, I have asked the question too soon. The answer is here: http://silverlight.codeplex.com/workitem/7643

1

The solution is

protected override void OnBackKeyPress(CancelEventArgs e)
{
    base.OnBackKeyPress(e);
    if (yourListPicker.ListPickerMode == ListPickerMode.Expanded)
    {
        yourListPicker.ListPickerMode = ListPickerMode.Normal;
        e.Cancel = true;
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.