Search code examples
xamlwindows-phone-8windows-phonewindows-phone-8.1

Change ItemSize in ListPicker Windows Phone


enter image description hereI'm new to windows mobile apps. I have a pivot page and inside that there is multiple pivot items. Inside the pivot item there is list picker which values are hard coded. If there is more items in list picker all items show in a new page by default. My issue is since all the item font are too small when opening the screen. How can I change the font size of list picker items when those are opening. My code like this.

<toolkit:ListPicker Grid.Row="0" Grid.Column="2" FontSize="21" Header="" Margin="10,12,-157,12" Background="White" Foreground="Black"  BorderThickness="1"  >
                        <sys:String>Convenience Eateries (CE)</sys:String>
                        <sys:String>Grocery Store (GS)</sys:String>
                        <sys:String>Secondary Network-ASD</sys:String>
                        <sys:String>Secondary Network-PSD</sys:String>
                        <sys:String>Cash and Carry</sys:String>
                        <sys:String>Modern Trade-Convenience Organized</sys:String>
                        <sys:String>Modern Trade-Grocery independent(SMMT)</sys:String>
                        <sys:String>HoReCa-Leisure outlets</sys:String>
                        <sys:String>HoReCa-Sports Clubs</sys:String>
                        <sys:String>HoReCa-Night Clubs</sys:String>
                        <sys:String>HoReCa-Karaoke</sys:String>
                        <sys:String>HoReCa-Casino</sys:String>
                        <sys:String>HoReCa-Café and Restaurant/Pubs</sys:String>
                        <sys:String>HoReCa-Other</sys:String>
                        <sys:String>Military-Welfare Shop</sys:String>
                        <sys:String>Military-Canteen</sys:String>
                        <sys:String>Convenience Mobile Outlets</sys:String>
                        <sys:String>Unconventional Outlets-Wine Stores</sys:String>
                        <sys:String>Unconventional Outlets-Other</sys:String>
                    </toolkit:ListPicker>

Solution

  • To change how the items look in the full mode page, you need to change the ListPicker's FullModeItemTemplate property. Something like this:

    <toolkit:ListPicker>
        <toolkit:ListPicker.FullModeItemTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding}" FontSize="25" />
            </DataTemplate>
        </toolkit:ListPicker.FullModeItemTemplate>
        <sys:String>Convenience Eateries (CE)</sys:String>
        <sys:String>Grocery Store (GS)</sys:String>
        <!-- Hard coded values go here, just as in your code. -->
    </toolkit:ListPicker>