在gridview中滚动时将整个项目捕捉到完整视图

时间:2015-08-04 10:19:10

标签: c# winrt-xaml

我有一个GridView,它在一行可滚动的VirtualizingStackPanel中显示图像。我希望能够在用户滚动事物时显示整个图像,并以不显示100%的方式暂停。基本上将项目(图像)捕捉到完整视图。

我的代码:

        <GridView 
            x:Name="m_acVideosView" Grid.Row="1" 
ItemsSource="{Binding Path=UserVideos, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
            Style="{StaticResource VideosGridView}" 
            ScrollViewer.ZoomMode="Disabled" 
            SelectionMode="None" IsItemClickEnabled="True" 
            VirtualizingStackPanel.VirtualizationMode="Recycling">

            <GridView.ItemsPanel>
                <ItemsPanelTemplate>
                    <VirtualizingStackPanel Orientation="Horizontal" 
VirtualizingStackPanel.VirtualizationMode="Recycling"/>
                </ItemsPanelTemplate>
            </GridView.ItemsPanel>

<Border>
<ScrollViewer x:Name="m_cVideosScroll"  
ManipulationCompleted="m_cVideosScroll_ManipulationCompleted"
ViewChanged="m_cVideosScroll_ViewChanged" >
</Border>

            <GridView.ItemTemplate>
                <DataTemplate>
                            <Image Tag="{Binding}" Source="{Binding Thumbnail}"  
VerticalAlignment="Stretch" Margin="9"
                               Width="270" Height="480" />
                </DataTemplate>
            </GridView.ItemTemplate>

        </GridView>

0 个答案:

没有答案