0
votes

I am using GridViews representing files of different folders. Those GridViews with one row and horizontal orientation are orderd within an vertical ListView.

Here you get an idea from code:

<ListView ItemSource={Binding CollectionOfFolders}>

    <ListView.ItemTemplate>

        <GridView>

            <GridView.ItemsPanel>
                <ItemsPanelTemplate>
                    <ItemsWrapGrid Loaded="WrapGridLoaded"
                           MaximumRowsOrColumns="1"
                           Orientation="Vertical" />
                </ItemsPanelTemplate>
            </GridView.ItemsPanel>

            <GridView.ItemTemplate>
                ...
            </GridView.ItemTemplate>

        </GridView>

    </ListView.ItemTemplate>

</ListView>

And a visual impression here:

Screenshot

The problem is the handling of the vertical and horizontal scrolling.

With toch input everythings works as desired: When you move your finger up and down, you scroll through the listview (the folders). If you move your finger horizontally your scroll through the GridView (files).

The problem comes, when using a mouse wheel or touchpad with the two finger sroll gesture: When the pointer is on any item or file respectivley, it doesn't affect the ListView. All gestures do affect the gridview only.

I tried to disable and enable the vertical and horizontal scrollmodes, the IsVertical/HorizontalModeChanningEnabled property and also the effects of the scroll bar and scroll rail visibility.

I fount these questions related to the problem, but could find a solution for this specific problem I just decriped:

It would be great if anybody does have ideas or even a solution.

1

1 Answers

0
votes

The problem comes, when using a mouse wheel or touchpad with the two finger sroll gesture: When the pointer is on any item or file respectivley, it doesn't affect the ListView. All gestures do affect the gridview only.

The problem is that the GridView item would capture the mouse wheel and double point scroll gesture when it focused. For your requirement, you could disable this feature manually.

You can use the inner GridView item PointerEntered and ViewChanged event to achieve this effect. When the inner GridView item scrolls to top or bottom make it ScrollMode be Disabled, meanwhile we make the inner GridView item ScrollMode be Enabled when the pointer enter into the inner GridView item.

And I found the similar issue in msdn and it has complete reply that you could refer.