我正在开发一个Windows通用应用程序,我在Xaml中有这个GridView:
<Grid Grid.Column="1" Height="700" VerticalAlignment="Bottom" Name="GridPoints" Margin="0,0,0,0">
<GridView x:Name="GridViewList" ItemsSource="{Binding Points}" ItemClick="GridView_ItemClick" IsItemClickEnabled="True"
ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollMode="Enabled" ScrollViewer.HorizontalScrollMode="Disabled"
ItemContainerStyle="{Binding Source={StaticResource GridViewItemContainer}}" SelectedItem="{Binding SlectedPoint, Mode=TwoWay}" >
<GridView.ItemTemplate>...etc...
我需要更改滚动查看器的位置,以便在绑定列表中显示我选定的点上的焦点。
答案 0 :(得分:0)
也许您正在寻找:
ScrollViewer.ScrollToVerticalOffset(double);
希望这有帮助!