This project has moved and is read-only. For the latest updates, please go here.
1
Vote

CustomMessageBox: how to use with a ListPicker in PickerMode.Expanded ?

description

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) || (listPicker.ListPickerMode == ListPickerMode.Full))
                    {
                        e1.Cancel = true;
                    }
                };
How can I make it work correctly?

Thanks
Enzo Contini

comments

continienzo wrote Oct 23, 2013 at 2:45 PM

I tried also with the following code but the fullMode selecting page is now visible but not enabled, so no selection casn be mage ....
:-(
            messageBox.Dismissing += (s1, e1) =>
                {
                    if ((listPicker.ListPickerMode == ListPickerMode.Expanded) || (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;
                    }
                };

summerrain_90 wrote Jan 28, 2015 at 6:58 AM

in Phone tookit source code increase ItemCountThresholdProperty will help