欢迎来到Doc100.Net免费学习资源知识分享平台!
您的位置:首页 > 程序异常 >

longlistselector 出现错误。

更新时间: 2014-01-05 02:38:11 责任编辑: Author_N1

 

LongListSelector 出现异常。急!
异常:
{System.ArgumentException: Value does not fall within the expected range.}
{System.Collections.ListDictionaryInternal}

这个发生在我逐条删除LongListSelector数据是发生的, MainLongListSelector.ItemsSource 是和ObservableCollection绑定以便动态删除,可是当我每次删除到8,9条时就会发生如上异常。

 我的xmal:
<phone:LongListSelector x:Name="MainLongListSelector" Margin="0,0,-12,0" ItemsSource="{Binding DuplicateContacts}">
            <phone:LongListSelector.ItemTemplate>
                <DataTemplate>
                    <StackPanel>
                        <Grid>                
                            <TextBlock Text="{Binding DisplayName}" 
                                   Foreground="Black" 
                                   TextTrimming="WordEllipsis"
                                   Margin="30,10,50,10"
                                   VerticalAlignment="Center"
                                   Style="{StaticResource PhoneTextLargeStyle}"/>
                            <Button x:Name="Detail" 
                                HorizontalAlignment="Right" BorderThickness="0"
                                VerticalAlignment="Bottom"
                                Margin="0,10,20,10"
                                Click="Detail_Click">
                                <Button.Background>
                                    <ImageBrush Stretch="Uniform" ImageSource="/Images/rightwards.png"/>
                                </Button.Background>
                            </Button>
                        </Grid>
                        <toolkit:ContextMenuService.ContextMenu>
                            <toolkit:ContextMenu IsZoomEnabled="True">
                                <toolkit:MenuItem Header="Delete" CommandParameter="{Binding}"
                                                      Click="MenuItem_Click"/>
                            </toolkit:ContextMenu>
上一篇:上一篇
下一篇:下一篇

 

随机推荐程序问答结果

 

 

如对文章有任何疑问请提交到问题反馈,或者您对内容不满意,请您反馈给我们DOC100.NET论坛发贴求解。
DOC100.NET资源网,机器学习分类整理更新日期::2014-01-05 02:38:11
如需转载,请注明文章出处和来源网址:http://www.doc100.net/bugs/t/12404/
本文WWW.DOC100.NET DOC100.NET版权所有。