我正在使用FlipView
. 在 BottomAppBar 中,我放置了所有图像中的一个,以便当我在 中单击它时ListView
能够查看图像,并在 中选择显示的图像(如分页)。FlipView
ListView
FlipView
ListView
在listView.selectionChanged
事件中,FlipView
当我在ListView
. 这是代码:
private void listView_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
string CurrentViewState = ApplicationView.GetForCurrentView().Orientation.ToString();
int IndicatorIndex = listView.SelectedIndex;
GoToPage(CurrentViewState, IndicatorIndex);
}
private void GoToPage(string CurrentViewState, int IndicatorIndex)
{
if (CurrentViewState == "Portrait")
{
flipView1.SelectedIndex = IndicatorIndex;
}
else if (CurrentViewState == "Landscape")
{
if (IndicatorIndex % 2 == 0)
flipView1.SelectedIndex = IndicatorIndex / 2;
else
{
if (IndicatorIndex == 1)
flipView1.SelectedIndex = 1;
else
flipView1.SelectedIndex = (IndicatorIndex + 1) / 2;
}
}
}
现在当我需要listView.SelectedIndex
根据flipView.SelectedIndex
listView.SelectedIndex = flipView.SelectedIndex
我有一个例外:
An exception of type 'System.ArgumentException' occurred in eBookApp.exe but was not handled in user code. Additional information: Value does not fall within the expected range.
我需要能够在FlipView
, selected 和 scrollAt 中选择相同的图像ListView
...