2

I tried to use the CustomMessageBox with a listpicker in PickerMode.Expanded but I'm having problems.

The same problems can be seen running the CustomMessageBoxSample after changing the ItemsSource = new string[] { "5 minutes", "10 minutes", "1 hour", "4 hours", "1 day", "2 days", "10 day" } , that is with more than 5 elements so it will open in FullMode by default.

In this case, leaving the other code example as it is, clicking the listpicker opens the fullMode selecting page but, after a selection, the whole CustomMessageBox is closed (you cannot decide to press its left or right button). I tried to change the code as follows, but in this case the fullMode selecting page is opened behind the messageBox and cannot be seen and no selection can be done (you can see it, in greyed, if you put many items so it has a long list of items so some of them can be displayed in background below the foreground messagebox.

messageBox.Dismissing += (s1, e1) =>
            {

                //if ((listPicker.ListPickerMode == ListPickerMode.Expanded) 
                if ((listPicker.ListPickerMode == ListPickerMode.Expanded) || (listPicker.ListPickerMode == ListPickerMode.Full))
                {
                    e1.Cancel = true;
                }
            };

I tried also with the following code but the fullMode selecting page, even though is now visible, it is not enabled, so no selection can be done ....

messageBox.Dismissing += (s1, e1) => {
 if (listPicker.ListPickerMode == ListPickerMode.Expanded) 
  {
     e1.Cancel = true;
  }
 else if (listPicker.ListPickerMode == ListPickerMode.Full)
  {
      e1.Cancel = true;
      messageBox.Visibility = Visibility.Collapsed;
      //listPicker.IsEnabled = true; //???
      // listPicker.Focus(); //???
      // listPicker.UpdateLayout(); //???
  }
};

listPicker.SelectionChanged += (s3, e3) => {
  if (listPicker.ListPickerMode == ListPickerMode.Full) {
    messageBox.Visibility = Visibility.Visible;
  }
};

Any suggestion?

Thanks Enzo Contini

  • I know it's been a long time, but I'm having the exact same issue here, did you manage to make it work? – gfpacheco Oct 25 '15 at 00:13

0 Answers0