windows-phone-7 - ListPicker 在全屏时崩溃 - 适用于 WP7 的 Silverlight 工具包

标签 windows-phone-7 silverlight-toolkit

当实现 ListPicker 时,当有足够的项目使其全屏时它会崩溃。如果只有 2-3 个项目,它不会崩溃,它只是展开。我收到一个 ArgumentException,“参数不正确”

<toolkit:ListPicker Grid.Row="1" 
                    ItemTemplate="{Binding lpkItemTemplate}" 
                    FullModeItemTemplate="{Binding lpkFullItemTemplate}">
    <toolkit:ListPicker.Items>
        <toolkit:ListPickerItem>1</toolkit:ListPickerItem>
        <toolkit:ListPickerItem>5</toolkit:ListPickerItem>
        <toolkit:ListPickerItem>10</toolkit:ListPickerItem>
        <toolkit:ListPickerItem>15</toolkit:ListPickerItem>
        <toolkit:ListPickerItem>20</toolkit:ListPickerItem>
        <toolkit:ListPickerItem>30</toolkit:ListPickerItem>            
    </toolkit:ListPicker.Items>
</toolkit:ListPicker>

模板是

<phone:PhoneApplicationPage.Resources>

    <DataTemplate x:Name="lpkItemTemplate">

        <TextBlock Text="{Binding Content}" />

    </DataTemplate>

    <DataTemplate x:Name="lpkFullItemTemplate">

        <TextBlock Text="{Binding Content}" />

    </DataTemplate>

</phone:PhoneApplicationPage.Resources>

我查看了示例,但没有发现与我在这里看到的有什么不同,而且它是有效的。唯一的区别是示例正在执行数据绑定(bind)。我试过单步执行控件的代码,但没有看到任何弹出的内容。在 ListPicker 中的“OnManipulationCompleted”事件处理程序完成后,它会在基类“ItemsControl”中引发异常。

知道我做错了什么吗?

最佳答案

FullMode 仅适用于 DataBinding,不适用于静态 ListPickerItems。

关于windows-phone-7 - ListPicker 在全屏时崩溃 - 适用于 WP7 的 Silverlight 工具包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7465400/

相关文章:

sqlite - 我可以在WP7应用程序中使用Sqlite数据库吗

windows-phone-7 - Windows Phone 8 上的 Windows Phone 7 应用程序

c# - LongListMultiSelector 添加到选定的项目改为添加 2 个项目

c# - 数据网格拖放目标 : Change Icon depending on the drop target

c# - 与 Viewmodel 的列表框数据绑定(bind)未显示 Windows Phone

windows-phone-7 - 使用 ViewModelLocator 抓取其他 VM 以在另一个 Vm 中使用是否不好?

validation - TabControl 上的剩余验证工具提示

windows-phone-7 - 记住 LongListSelector 的位置

silverlight - 在 Silverlight NumericUpDown 更改值之前触发 MVVM 中继命令

windows-phone-7 - 在后台代理上运行探查器