9
Vote

Custom ListPickerPage

description

I have a scenario where I need a custom list picker page to navigate through hierarchical data.
The ListPicker control has a PickerPageUri property but uses internaly the ListPickerPage class.
So the control doesn't work with a custom list picker page and I had to modify the source of the ListPicker.

It would be nice to have an interface for the list picker page.
I use the following code and it works fine for me:
    public interface IListPickerPage
    {
        object SelectedItem { get; set; }
        System.Collections.IList Items { get; }
        System.Collections.IList SelectedItems { get; }
        System.Windows.FlowDirection FlowDirection { get; set; }
        string HeaderText { get; set; }
        System.Windows.DataTemplate FullModeItemTemplate { get; set; }
        System.Windows.Controls.SelectionMode SelectionMode { get; set; }
    }
In the ListPicker.cs I modified the following lines:
[Line 71]      private IListPickerPage _listPickerPage;
[Line 1319]    _listPickerPage = e.Content as IListPickerPage;
And of course the ListPickerPage has to implement the interface:
    public partial class ListPickerPage : PhoneApplicationPage, IListPickerPage
I hope you can change this so that no modification of the source is required to use a custom list picker page.
Thanks.

comments

Kenrae wrote Mar 13, 2014 at 10:57 AM

I came here to say exactly the same. I hope you can implement this small change. It's weird that it's not done since this approach is already there with DatePickerPage and TimePickerPage.