Windows phone 8 在Windows Phone 8中更改刷卡时的详细页面数据

Windows phone 8 在Windows Phone 8中更改刷卡时的详细页面数据,windows-phone-8,Windows Phone 8,使用MVVM框架测试Windows Phone 8应用程序 ListPage.xaml: <phone:PanoramaItem x:Name="mpnP" Width="475"> <Grid Style="{StaticResource GridPanoPage}" > <ListBox x:Name="pkList" Style="{StaticResource ListBoxHeadlines}" >

使用MVVM框架测试Windows Phone 8应用程序

ListPage.xaml:

<phone:PanoramaItem x:Name="mpnP"  Width="475">
    <Grid Style="{StaticResource GridPanoPage}" >
         <ListBox x:Name="pkList" Style="{StaticResource ListBoxHeadlines}" >
            <ListBox.ItemTemplate>
                <DataTemplate >
                    <ListBoxItem Style="{StaticResource ListBoxItemHub}">
                        <StackPanel Orientation="Horizontal">
                            <Image x:Name="pkImage" Source="{Binding ImagePath}" />
                            <StackPanel>
                                <TextBlock x:Name="pkHead" Text="{Binding Head}"/>
                             </StackPanel>
                        </StackPanel>
                    </ListBoxItem>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
     </Grid>
</phone:PanoramaItem>
现在我想在滑动屏幕上导航到下一个ID。意味着- 如果ID--3当前在屏幕上,并且如果用户滑动屏幕,则下一个ID详细信息将显示在屏幕上。
此过程一直持续到列表框最后一个id。

在详细信息页面上,可以借助FlipView在多个项目之间导航。每次事件SelectionChange发生时,都会更改ViewModel中的Id

<toolkit:FlipView x:Name="FlipViewImages" ItemsSource="{Binding Images}" >
            <toolkit:FlipView.ItemTemplate>
                <DataTemplate>
                    <utils:ImageZoomControl Url="{Binding}"/>
                </DataTemplate>
            </toolkit:FlipView.ItemTemplate>
            <toolkit:FlipView.ItemsPanel>
                <ItemsPanelTemplate>
                    <VirtualizingStackPanel Orientation="Horizontal"/>
                </ItemsPanelTemplate>
            </toolkit:FlipView.ItemsPanel>
        </toolkit:FlipView>

FlipView不是本机控件,您必须通过nuget Manager、Windows Phone ToolKit导入。 如果项目源是对象列表,则不需要执行任何其他操作

<toolkit:FlipView x:Name="FlipViewImages" ItemsSource="{Binding Images}" >
            <toolkit:FlipView.ItemTemplate>
                <DataTemplate>
                    <utils:ImageZoomControl Url="{Binding}"/>
                </DataTemplate>
            </toolkit:FlipView.ItemTemplate>
            <toolkit:FlipView.ItemsPanel>
                <ItemsPanelTemplate>
                    <VirtualizingStackPanel Orientation="Horizontal"/>
                </ItemsPanelTemplate>
            </toolkit:FlipView.ItemsPanel>
        </toolkit:FlipView>