Windows Phone 7的ListPicker控件未打开完整选择窗口

Onl*_*ere 2 c# windows-phone-7 listpicker

这是空闲时的样子:

在此输入图像描述

在这里,当我点击它时,应该弹出全屏选择模式(根据我读过的内容):

在此输入图像描述

如您所见,它似乎没有打开全屏选择模式.

这是我的XAML:

<phone:PhoneApplicationPage 
    x:Class="GameLense.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <Grid>
        <Grid.Resources>
            <DataTemplate x:Name="PickerItemTemplate">
                <StackPanel Orientation="Horizontal">
                    <Border Background="Transparent" Width="34" Height="34">
                        <Image Source="{Binding ImagePath}" Margin="12 0 0 0" 
                               VerticalAlignment="Center" 
                               HorizontalAlignment="Center" 
                               Stretch="Fill"/>
                    </Border>
                    <TextBlock Text="{Binding Name}" Margin="12 0 0 0"/>
                </StackPanel>
            </DataTemplate>
            <DataTemplate x:Name="PickerFullModeItemTemplate">
                <StackPanel Orientation="Horizontal">
                    <Border Background="Gold" Width="34" Height="34">
                        <Image Source="{Binding ImagePath}" Margin="12 0 0 0" VerticalAlignment="Center" HorizontalAlignment="Center" />
                    </Border>
                    <TextBlock Text="{Binding Name}" Margin="12 0 0 0"/>
                </StackPanel>
            </DataTemplate>
        </Grid.Resources>

        <Grid.RowDefinitions>
            <RowDefinition Height="100" />
            <RowDefinition />
        </Grid.RowDefinitions>

        <!--Begin Top Bar -->
        <Image Grid.Row="0" Source="Images/topbarBg.png" Stretch="Fill" />
        <TextBlock Text="Console" HorizontalAlignment="Left" 
                   VerticalAlignment="Center" FontSize="35" 
                   Padding="10"/>

        <toolkit:ListPicker x:Name="lstPlatform" 
                            ListPickerMode="Full"
                            Grid.Row="0" CacheMode="BitmapCache"
                            Margin="160 0 10 0" VerticalAlignment="Center"
                            ItemTemplate="{StaticResource PickerItemTemplate}" 
                            FullModeItemTemplate="{StaticResource PickerFullModeItemTemplate}" />

        <!--End Top Bar -->

    </Grid>

</phone:PhoneApplicationPage>
Run Code Online (Sandbox Code Playgroud)

关于我可能做错的任何想法?

小智 7

您已在ItemCountThreshold="0"ListPicker控件上设置,以便立即进入全屏选择模式.


小智 6

您也可以ExpansionMode="FullScreenOnly"在listpicker上设置以解决此问题.