-
Notifications
You must be signed in to change notification settings - Fork 796
Description
Describe the bug
I want to read the Container Property from the ManipulationEventArgs. But I get a null reference Exception for this property if I touch the Screen a second time.
As a second effect the Touch Position contains an offset. It seems that the Position is relative to the parent control.
Steps to reproduce the bug
- create a sample WinUI 3 App with a rectangle as content.
- Set manipulationMode = "All" in the code
- Add eventhandler for all "Manipulation" events
- Write a DebugOutput into each eventhadler.
- run the app
- do pan or rotate gestures on screen (first time)
- do the same a second time
- check the debug output
Result:
I use a SwapChainPanel and I have set the manipulation mode property to "All".
The first time I do a pan gesture on the UiElement I receive the following events in this order:
- OnManipulationStarting
- OnManipulationStarted
- OnManipulationDelta ............... (n times)
- OnManipulationInertiaStarting
- OnManipulationDelta .... (m times)
- OnManipulationCompleted
This seems to be OK, but (second tap result!):
If I do this a second time or more often, the "OnManipulationStarting" event handler is not called !
And then the Container Property is null!
Expected behavior
On the second call and on any further calls the OnManipulationStarting event is missing and the Container Property is null!
I would expect the same behaviour as in the first call.
Screenshots
No response
NuGet package version
WinUI 3 - Windows App SDK 1.0
Windows app type
- UWP
- Win32
Device form factor
Desktop
Windows version
Windows 11 (21H2): Build 22000
Additional context
If another UIElement gets the focus and the user set the focus back to the swapChainPanel again, the next tap will call the Manipulationstarting event.
It feels like this behaviour mentioned in the WinUI documentation:
https://docs.microsoft.com/en-us/windows/winui/api/microsoft.ui.xaml.uielement.manipulationstarting?view=winui-3.0#windows8-behavior
But I use it on Windows 11!