8.0 ( 8.1 EDIT). ScrollViewer GridView GridView , . , , ScrollViewer ( Canvas , Canvas.SetLeft ).
, , , ScrollViewer DirectX- ViewChanged, - :
XAML
<Page
x:Class="App84.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App84"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid
Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<GridView>
<Grid
Width="300"
Height="300">
<Rectangle
x:Name="DirectXControlPlaceholder"
Width="300"
Height="300"
Fill="Yellow" />
<ScrollViewer
x:Name="ManipulationCaptureScrollViewer"
Style="{StaticResource VerticalScrollViewerStyle}"
VerticalScrollBarVisibility="Hidden"
ViewChanged="ScrollViewer_OnViewChanged">
<Rectangle
Width="200"
Height="10000"
Fill="Transparent"/>
</ScrollViewer>
<TextBlock
x:Name="OffsetTextBlock"
Foreground="Black"
FontSize="24"
VerticalAlignment="Center"
HorizontalAlignment="Center"
/>
</Grid>
<Rectangle
Width="300"
Height="300"
Fill="GreenYellow" />
<Rectangle
Width="300"
Height="300"
Fill="LimeGreen" />
<Rectangle
Width="300"
Height="300"
Fill="Red" />
<Rectangle
Width="300"
Height="300"
Fill="OrangeRed" />
<Rectangle
Width="300"
Height="300"
Fill="DarkOrange" />
<Rectangle
Width="300"
Height="300"
Fill="Orange" />
</GridView>
</Grid>
</Page>
using Windows.UI.Xaml.Controls;
namespace App84
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
}
private void ScrollViewer_OnViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
{
OffsetTextBlock.Text =
ManipulationCaptureScrollViewer.VerticalOffset.ToString();
}
}
}
*
Windows 8.1 ManipulationModes.System, ( ) ScrollViewer. CancelDirectManipulations() , , ScrollViewers .