Search code examples
xamlwindows-phone-8silverlight-toolkit

Windows phone toolkit ListPicker only allowing 5 elements


I have a simple working example:

   <!--ContentPanel - place additional content here-->
    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
        <toolkit:ListPicker>
            <toolkit:ListPickerItem Content="FIRST" />
            <toolkit:ListPickerItem Content="SECOND" />
            <toolkit:ListPickerItem Content="THIRD" />
            <toolkit:ListPickerItem Content="FOURTH" />
            <toolkit:ListPickerItem Content="FIFTH" />
            <toolkit:ListPickerItem Content="SIXTH" />
        </toolkit:ListPicker>
    </Grid>

create a new windows phone 8 app, install the windows phone toolkit nuget package, then add only the listpicker as shown above. It will blow. But, if you delete the sixth ListPickerItem, then it works.

Has anyone else gotten the listpicker to work? Do I need to add the items in code to get this to work?


Solution

  • by default list picker only allow 5 elements to show on the same view if it is more than that it will show it will take a full single view to show the elements and for that you have to add the elements from code behind. or you can change ItemCountThreshold.