Created
June 2, 2025 20:01
-
-
Save jpd21122012/0920d8d0194ae25df2078375975ddc7c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SwipePinchPage : ContentPage | |
{ | |
public SwipePinchPage() | |
{ | |
var swipeGesture = new SwipeGestureRecognizer(); | |
swipeGesture.Swiped += (s, e) => | |
{ | |
Console.WriteLine($"Swipe direction: {e.Direction}"); | |
}; | |
var pinchGesture = new PinchGestureRecognizer(); | |
pinchGesture.PinchUpdated += (s, e) => | |
{ | |
Console.WriteLine($"Pinch scale: {e.Scale}"); | |
}; | |
var frame = new Frame | |
{ | |
BackgroundColor = Colors.LightGray, | |
Content = new Label { Text = "Swipe or Pinch Me!" } | |
}; | |
frame.GestureRecognizers.Add(swipeGesture); | |
frame.GestureRecognizers.Add(pinchGesture); | |
Content = frame; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment