Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/335.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在长列表选择器windows phone 8中选择下一项_C#_Windows Phone 8_Selecteditem_Longlistselector - Fatal编程技术网

C# 在长列表选择器windows phone 8中选择下一项

C# 在长列表选择器windows phone 8中选择下一项,c#,windows-phone-8,selecteditem,longlistselector,C#,Windows Phone 8,Selecteditem,Longlistselector,我有一个应用程序,其中LongListSelector显示来自web服务的图片列表,当用户单击图片时,会弹出一个大型图像查看器并显示它 我想实现的是下一个键,按下该键时,将选择LongListSelector中的下一项 如果我使用的是列表框,我只会使用流动的代码 ListBox.SelectedIndex = ListBox.SelectedIndex + 1; 然后,我将处理SelectionChanged事件中的代码。 但是LongListSelector没有。SelectedIndex只

我有一个应用程序,其中LongListSelector显示来自web服务的图片列表,当用户单击图片时,会弹出一个大型图像查看器并显示它

我想实现的是下一个键,按下该键时,将选择LongListSelector中的下一项

如果我使用的是列表框,我只会使用流动的代码

ListBox.SelectedIndex = ListBox.SelectedIndex + 1;
然后,我将处理SelectionChanged事件中的代码。 但是LongListSelector没有
。SelectedIndex
只有
。SelectedItem

使用LongListSelector有类似的方法吗


谢谢。

获取
SelectedItem
,在您的收藏中找到它的索引,然后将收藏中索引为+1的项目分配给
SelectedItem

我可以使用以下
选择器获取所选索引。项目资源索引of(selector.SelectedItem as translateeditem2)
但是如何将索引+1分配给
SelectedItem
?selector.SelectedItem=selector.ItemsSource[index+1]谢谢,我唯一的问题是我无法将索引[]应用于IEnumerable。我最终使用了这个
GridView.ItemsSource.Cast().ElementAt(currentpic+1)这样很好,谢谢你给我指明了正确的方向。