How to allow manipulation in the controls of a ListView / GridView Item, allowing you to scroll and cross-slide manipulations in a ListView / GridView?

In particular, I have a user control that receives manipulation events to scroll through a custom DirectX control. This control and other similar elements are GridView elements. I want the GridView to be able to scroll horizontally using the default TranslateRailsX manipulation, while the controls should be able to receive TranslateRailsY manipulation events.

In my experiments so far, having set the manipulation mode with the controls to the system, I can make the GridView scroll, but the controls will not receive any manipulation events. By setting the control mode to All, or TranslateY, or TranslateRailsY controls, I can get my custom control to receive manipulation events, but scrolling the GridView touch panel will not work.

How can I resolve BOTH of these manipulations?

+2
source share
2 answers

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 .

+2

ManipulationMode xaml. , , .

ManipulationMode="TranslateX,System"
+1

All Articles