-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b66a4dd
commit 533a2b5
Showing
2 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
100 changes: 100 additions & 0 deletions
100
src/BlazorBindings.Maui/Elements/PointerGestureRecognizer.generated.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
// <auto-generated> | ||
// This code was generated by a BlazorBindings.Maui component generator. | ||
// | ||
// Changes to this file may cause incorrect behavior and will be lost if | ||
// the code is regenerated. | ||
// </auto-generated> | ||
|
||
using BlazorBindings.Core; | ||
using MC = Microsoft.Maui.Controls; | ||
using Microsoft.AspNetCore.Components; | ||
using System.Threading.Tasks; | ||
|
||
#pragma warning disable MBB001 | ||
|
||
namespace BlazorBindings.Maui.Elements | ||
{ | ||
/// <summary> | ||
/// Provides pointer gesture recognition and events. | ||
/// </summary> | ||
public partial class PointerGestureRecognizer : GestureRecognizer | ||
{ | ||
static PointerGestureRecognizer() | ||
{ | ||
RegisterAdditionalHandlers(); | ||
} | ||
|
||
[Parameter] public EventCallback<MC.PointerEventArgs> OnPointerEntered { get; set; } | ||
[Parameter] public EventCallback<MC.PointerEventArgs> OnPointerExited { get; set; } | ||
[Parameter] public EventCallback<MC.PointerEventArgs> OnPointerMoved { get; set; } | ||
[Parameter] public EventCallback<MC.PointerEventArgs> OnPointerPressed { get; set; } | ||
[Parameter] public EventCallback<MC.PointerEventArgs> OnPointerReleased { get; set; } | ||
|
||
public new MC.PointerGestureRecognizer NativeControl => (MC.PointerGestureRecognizer)((BindableObject)this).NativeControl; | ||
|
||
protected override MC.PointerGestureRecognizer CreateNativeElement() => new(); | ||
|
||
protected override void HandleParameter(string name, object value) | ||
{ | ||
switch (name) | ||
{ | ||
case nameof(OnPointerEntered): | ||
if (!Equals(OnPointerEntered, value)) | ||
{ | ||
void NativeControlPointerEntered(object sender, MC.PointerEventArgs e) => InvokeEventCallback(OnPointerEntered, e); | ||
|
||
OnPointerEntered = (EventCallback<MC.PointerEventArgs>)value; | ||
NativeControl.PointerEntered -= NativeControlPointerEntered; | ||
NativeControl.PointerEntered += NativeControlPointerEntered; | ||
} | ||
break; | ||
case nameof(OnPointerExited): | ||
if (!Equals(OnPointerExited, value)) | ||
{ | ||
void NativeControlPointerExited(object sender, MC.PointerEventArgs e) => InvokeEventCallback(OnPointerExited, e); | ||
|
||
OnPointerExited = (EventCallback<MC.PointerEventArgs>)value; | ||
NativeControl.PointerExited -= NativeControlPointerExited; | ||
NativeControl.PointerExited += NativeControlPointerExited; | ||
} | ||
break; | ||
case nameof(OnPointerMoved): | ||
if (!Equals(OnPointerMoved, value)) | ||
{ | ||
void NativeControlPointerMoved(object sender, MC.PointerEventArgs e) => InvokeEventCallback(OnPointerMoved, e); | ||
|
||
OnPointerMoved = (EventCallback<MC.PointerEventArgs>)value; | ||
NativeControl.PointerMoved -= NativeControlPointerMoved; | ||
NativeControl.PointerMoved += NativeControlPointerMoved; | ||
} | ||
break; | ||
case nameof(OnPointerPressed): | ||
if (!Equals(OnPointerPressed, value)) | ||
{ | ||
void NativeControlPointerPressed(object sender, MC.PointerEventArgs e) => InvokeEventCallback(OnPointerPressed, e); | ||
|
||
OnPointerPressed = (EventCallback<MC.PointerEventArgs>)value; | ||
NativeControl.PointerPressed -= NativeControlPointerPressed; | ||
NativeControl.PointerPressed += NativeControlPointerPressed; | ||
} | ||
break; | ||
case nameof(OnPointerReleased): | ||
if (!Equals(OnPointerReleased, value)) | ||
{ | ||
void NativeControlPointerReleased(object sender, MC.PointerEventArgs e) => InvokeEventCallback(OnPointerReleased, e); | ||
|
||
OnPointerReleased = (EventCallback<MC.PointerEventArgs>)value; | ||
NativeControl.PointerReleased -= NativeControlPointerReleased; | ||
NativeControl.PointerReleased += NativeControlPointerReleased; | ||
} | ||
break; | ||
|
||
default: | ||
base.HandleParameter(name, value); | ||
break; | ||
} | ||
} | ||
|
||
static partial void RegisterAdditionalHandlers(); | ||
} | ||
} |
This file contains 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