Pointer Events were not triggered in WinUi3 #10327
Unanswered
Prem-Kumar-Shanmugam
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
My Xaml Structure :
<Canvas> <Canvas x:Name="BackCanvas" Width="10000" Height="1000" Background="Transparent" PointerPressed="Canvas_PointerPressed"/> <Canvas x:Name="FrontCanvas" Width="10000" Height="1000" /> </Canvas>
C# code :
private void Canvas_PointerPressed(object sender, PointerRoutedEventArgs e) { Debug.WriteLine("BackCanvas"); }
When i have structure like above, BackCanvas pointerPressed event is triggered correctly,because i didn't set background color for FrontCanvas.That's why the pointer Event is received by BackCanvas.
Incase if have Structure like below, the PointerPressed Event was not triggering...
My Xaml Code :
<Canvas> <Canvas x:Name="BackCanvas" Width="10000" Height="1000" Background="Transparent" PointerPressed="Canvas_PointerPressed"/> <ScrollViewer x:Name="Scroller"> <Canvas Width="5000" Height="5000"/> </ScrollViewer> </Canvas>
Here i'm having Scrollviewer instead of FrontCanvas.Here also i didn't set any background color for scrollviewer.But the BackCanvas PointerPressed event was not firing.
What i'm trying to acheive is i want to receive viewChange from scrollviewer and receive pointer events from BackCanvas while pointer actions.
NOTE: I can't keep the BackCanvas inside the ScrollViewer.My app structure was not like that.
What i'm trying to achieve is ---> we are rendering in SwapChainPanel. This rendering and my view Layer(like backCanvas) should sync while scrolling the scrollviewer and i need interaction with view Layer. My SwapChain,View,and Scrollviewer all were children inside a Canvas.
Beta Was this translation helpful? Give feedback.
All reactions