In my UWP Xbox app I would like to have a page where the content is in a ScrollViewer and allow the user to scroll the content in any direction with the left stick. I would like to have the Pointer cursor enabled for this page so that it can be used to move around the scroll area and click elements.
This is basically the same behavior that the Edge browser exhibits when you scroll down a page...when the Pointer gets to the edge of the content, the scroll occurs.
I've got a sample page that looks like this:
<Page
x:Class="MyApp.MyPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid>
<ScrollViewer x:Name="RootScrollViewer" IsTabStop="True" ZoomMode="Enabled" HorizontalScrollMode="Enabled" HorizontalScrollBarVisibility="Visible" VerticalScrollMode="Enabled" VerticalScrollBarVisibility="Visible" >
<Grid x:Name="TheGrid" Width="1400" Height="1400" Margin="{StaticResource DefaultAllMargin}">
<Rectangle Width="315" Height="200" VerticalAlignment="Top" HorizontalAlignment="Left" Fill="Green"/>
<Rectangle Width="315" Height="200" VerticalAlignment="Bottom" HorizontalAlignment="Left" Fill="Blue"/>
<Rectangle Width="315" Height="200" VerticalAlignment="Center" HorizontalAlignment="Center" Fill="Blue"/>
<Rectangle Width="315" Height="200" VerticalAlignment="Bottom" HorizontalAlignment="Right" Fill="Blue"/>
<Rectangle Width="315" Height="200" VerticalAlignment="Top" HorizontalAlignment="Right" Fill="Blue"/>
</Grid>
</ScrollViewer>
</Grid>
If I load this page the way it is, the left stick allows me to scroll the ScrollViewer in any direction, which is close to what I want. However, if I add the below code to my page constructor to enable the Pointer, I get the pointer, but now the left stick just moves the pointer around within the page, but doesn't scroll the ScrollViewer.
this.RequiresPointer = RequiresPointer.WhenFocused;
Anyone know how I can accomplish the pointer and the scrolling?
Update: I created some test apps using a ScrollViewer and also a WebView to compare how the mouse behaves one each. The way the out-of-box WebView behaves exactly like I want. I want the left stick to control the pointer and the right stick to control the scroll. So my question is this: is there a way to make native XAML content inside of a ScrollViewer behave the way web content does inside a WebView?