Xamarin Forms UWP GestureRecognizers are always "InputTransparent"

We recently startet to port one of our Apps to UWP too. Since its our first Project on UWP, we might overseen something.

Current State:
The App is working flawless productive on Android and iOS(Phone and Tablet). With minor changes over the last 8 Month including updating from Xamarin forms 2.5 in multible steps up to current 3.4

Problem:
On UWP all Gesture Recognizers wich are addet to all sorts of controls, seem to be Input Transparent. (In short: all behind laying GestureRecognizers also trigger).

I did try a few things (I Did read a bit about some Bug with missing Background colors and so on), but i could not solve this issue in any kind.

I see two reasons why this could happen to us:

  • We missed some major obvious setting to alter the behaviour of this stuff(In this case: what could that be?)
  • There is some kind of bug in Xamarin forms starting XF 3.0 up to current state(In this case: Is this known and and be worked around?)

If you need more information, please let me know, ill try to provide as much as i can.

Thank you
Bernhard

Best Answer

  • edited February 19 Accepted Answer

    If there is anybody facing the same Problem, i updated my linked repo there is indeed a different behaviour on UWP,
    (thanks to a friend of mine), what can be solved by setting the SelectionMode of this Listview.

    MainPage.xaml.cs
    ListView.SetSelectionMode(this.DemoListView, ListViewSelectionMode.Inaccessible);

    https://github.com/bPoller2810/XF-Demo-ListView-Gesture

Answers

  • jezhjezh Member, Xamarin Team Xamurai

    What do you meaning by said GestureRecognizers are always "InputTransparent" ?
    Could you please post more details?

  • For example i have a ViewCell, witch has a Grid inside where a Tap performs a filter for this list. In this grid is a Label(tested button and contentview also) to open a Context Menu.

    On UWP thisopens the context menu AND performs the filtering. so it seems the control for the context menu handles the input and then passes it to its parent too, wich doesnt happen on Android and iOS.

  • I Created a basic test project to show one of the different inconsistend behaviours accross platforms.

    If you tap on the gray area the items counter should be increased(Gesture is attatched to the boxview)
    If you tap the item outside of the gray area the listviews ItemTapped gesture is increasing the top counter number.

    Android: Samsung Galaxy S8 works like expected
    iOS: iPhone 6 works also like expected
    Windows 10: Laptop(Touch and mouse driven input tested) the ItemTapped also activates if you tap the gray boxview

    https://github.com/bPoller2810/XF-Demo-ListView-Gesture

    to me this looks like wrong behaviour.

    Little note: i use Xamarin Forms 3.4.0.1008975, because all later versions got me a TypeLoadException for this basic sample project

  • Bernhard_PollerspöckBernhard_Pollerspöck Member ✭✭
    edited February 19 Accepted Answer

    If there is anybody facing the same Problem, i updated my linked repo there is indeed a different behaviour on UWP,
    (thanks to a friend of mine), what can be solved by setting the SelectionMode of this Listview.

    MainPage.xaml.cs
    ListView.SetSelectionMode(this.DemoListView, ListViewSelectionMode.Inaccessible);

    https://github.com/bPoller2810/XF-Demo-ListView-Gesture

Sign In or Register to comment.