I have a ViewGraphics in my XAML defined like this:
<GraphicsView x:Name="Canvas" Drawable="{StaticResource Renderer}">
<GraphicsView.GestureRecognizers>
<TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped"/>
<PanGestureRecognizer PanUpdated="PanGestureRecognizer_PanUpdated" />
</GraphicsView.GestureRecognizers>
</GraphicsView>
And the corresponding implementation of PanGestureRecognizer_PanUpdated looks like this:
private void PanGestureRecognizer_PanUpdated(object sender, PanUpdatedEventArgs e)
{
Debug.WriteLine($"{e.StatusType} x:= {e.TotalX}|y:= {e.TotalY}");
}
The event only gives me the total changes since beginning but there is no way to access the point TotalX and TotalY are relative to. How can I obtain the position (just like TappedEventArgs provides a .GetPosition method)?
I already asked chatgpt but it stucked since it didnt understand that TotalX and TotalY only give the changes with respect to the point I want to find.
Okay I am guessing you want that x and y when you pan, to get that you can probably calculate it something like this
This would give you the current y, You would generally do this in the Running state(e.StatusType) otherwise this will always be zero.
You can similarly calculate the y as well