diff --git a/docs/reference/gestures/pinchgesturerecognizer.md b/docs/reference/gestures/pinchgesturerecognizer.md index 144725eae..b1bc22673 100644 --- a/docs/reference/gestures/pinchgesturerecognizer.md +++ b/docs/reference/gestures/pinchgesturerecognizer.md @@ -26,6 +26,24 @@ image.GestureRecognizers.Add(new PinchGestureRecognizer()); The PinchGestureRegonizer raises a `Gestures.PinchEvent` when it detects the start of a pull gesture. When the pull ends, from the pointer being released or another gesture start, it raises a `Gestures.PinchEndedEvent`. The `Scale` property in the args passed to the `Gestures.PinchEvent` event handler contains the relative size of the pinch since it started. +## Binding Events +After the PinchGestureRecognizer has been added to your control, you need to bind them in your code behind either through an inline handler or to an event function: +```csharp title='C#' +image.AddHandler(Gestures.PinchEvent, (s, e) => { }); +image.AddHandler(Gestures.PinchEndedEvent, (s, e) => { }); +``` +```csharp title='C#' +image.AddHandler(Gestures.PinchEvent, Image_PinchGesture); +image.AddHandler(Gestures.PinchEndedEvent, Image_PinchGestureEnded); +... +private void Image_PinchGesture(object? sender, PinchGestureEventArgs e) { } +private void Image_PinchGestureEnded(object? sender, PinchGestureEndedEventArgs e) { } +``` +If your event handles the gesture completely, you can mark the event as handled by setting: +```csharp title='C#' +e.Handled = true; +``` + ## More Information :::info diff --git a/docs/reference/gestures/pullgesturerecognizer.md b/docs/reference/gestures/pullgesturerecognizer.md index 048a8964e..7b57dd703 100644 --- a/docs/reference/gestures/pullgesturerecognizer.md +++ b/docs/reference/gestures/pullgesturerecognizer.md @@ -26,7 +26,7 @@ border.GestureRecognizers.Add(new PullGestureRecognizer() }); ``` -The PullGestureRegonizer raises a `Gestures.PullGestureEvent` when it detects the start of a pull gesture. When the pull ends, from the pointer being released or another gesture start, it raises a `Gestures.PullGestureEndedEvent`. +The PullGestureRecognizer raises a `Gestures.PullGestureEvent` when it detects the start of a pull gesture. When the pull ends, from the pointer being released or another gesture start, it raises a `Gestures.PullGestureEndedEvent`. ### PullDirection This defines the direction of the pull. There are 4 available values; @@ -35,6 +35,24 @@ This defines the direction of the pull. There are 4 available values; * `PullDirection.LeftToRight` : Pull starts from the left edge and moves towards the right * `PullDirection.RightToLeft` : Pull starts from the right edge and moves towards the top +## Binding Events +After the PullGestureRecognizer has been added to your control, you need to bind them in your code behind either through an inline handler or to an event function: +```csharp title='C#' +image.AddHandler(Gestures.PullGestureEvent, (s, e) => { }); +image.AddHandler(Gestures.PullGestureEndedEvent, (s, e) => { }); +``` +```csharp title='C#' +image.AddHandler(Gestures.PullGestureEvent, Image_PullGesture); +image.AddHandler(Gestures.PullGestureEndedEvent, Image_PullGestureEnded); +... +private void Image_PullGesture(object? sender, PullGestureEventArgs e) { } +private void Image_PullGestureEnded(object? sender, PullGestureEndedEventArgs e) { } +``` +If your event handles the gesture completely, you can mark the event as handled by setting: +```csharp title='C#' +e.Handled = true; +``` + ## Useful Properties You will probably use these properties most often: diff --git a/docs/reference/gestures/scrollgesturerecognizer.md b/docs/reference/gestures/scrollgesturerecognizer.md index ba7621731..048cec074 100644 --- a/docs/reference/gestures/scrollgesturerecognizer.md +++ b/docs/reference/gestures/scrollgesturerecognizer.md @@ -22,14 +22,31 @@ A ScrollGestureRecognizer can be attached to a control using the control's `Gest ```csharp title='C#' image.GestureRecognizers.Add(new ScrollGestureRecognizer() - { - CanVerticallyScroll = true, - CanHorizontallyScroll = true, - }); +{ + CanVerticallyScroll = true, + CanHorizontallyScroll = true, +}); ``` -The ScrollGestureRegonizer raises a `Gestures.ScrollGestureEvent` when it detects the start of a scroll gesture. When the scroll ends, from the pointer being released or another gesture start, it raises a `Gestures.ScrollGestureEndedEvent`. +The ScrollGestureRecognizer raises a `Gestures.ScrollGestureEvent` when it detects the start of a scroll gesture. When the scroll ends, from the pointer being released or another gesture start, it raises a `Gestures.ScrollGestureEndedEvent`. +## Binding Events +After the ScrollGestureRecognizer has been added to your control, you need to bind them in your code behind either through an inline handler or to an event function: +```csharp title='C#' +image.AddHandler(Gestures.ScrollGestureEvent, (s, e) => { }); +image.AddHandler(Gestures.ScrollGestureEndedEvent, (s, e) => { }); +``` +```csharp title='C#' +image.AddHandler(Gestures.ScrollGestureEvent, Image_ScrollGesture); +image.AddHandler(Gestures.ScrollGestureEndedEvent, Image_ScrollGestureEnded); +... +private void Image_ScrollGesture(object? sender, ScrollGestureEventArgs e) { } +private void Image_ScrollGestureEnded(object? sender, ScrollGestureEndedEventArgs e) { } +``` +If your event handles the gesture completely, you can mark the event as handled by setting: +```csharp title='C#' +e.Handled = true; +``` ## Useful Properties You will probably use these properties most often: