9 changed files with 75 additions and 109 deletions
@ -0,0 +1,23 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Avalonia.Input.GestureRecognizers |
||||
|
{ |
||||
|
public abstract class GestureRecognizer : StyledElement |
||||
|
{ |
||||
|
public abstract IInputElement? Target { get; } |
||||
|
public abstract void Initialize(IInputElement target); |
||||
|
public abstract void PointerPressed(PointerPressedEventArgs e); |
||||
|
public abstract void PointerReleased(PointerReleasedEventArgs e); |
||||
|
public abstract void PointerMoved(PointerEventArgs e); |
||||
|
public abstract void PointerCaptureLost(IPointer pointer); |
||||
|
|
||||
|
protected void Capture(IPointer pointer) |
||||
|
{ |
||||
|
(pointer as Pointer)?.CaptureGestureRecognizer(this); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,24 +0,0 @@ |
|||||
namespace Avalonia.Input.GestureRecognizers |
|
||||
{ |
|
||||
public interface IGestureRecognizer |
|
||||
{ |
|
||||
IInputElement? Target { get; } |
|
||||
void Initialize(IInputElement target, IGestureRecognizerActionsDispatcher actions); |
|
||||
void PointerPressed(PointerPressedEventArgs e); |
|
||||
void PointerReleased(PointerReleasedEventArgs e); |
|
||||
void PointerMoved(PointerEventArgs e); |
|
||||
void PointerCaptureLost(IPointer pointer); |
|
||||
} |
|
||||
|
|
||||
public interface IGestureRecognizerActionsDispatcher |
|
||||
{ |
|
||||
void Capture(IPointer pointer, IGestureRecognizer recognizer); |
|
||||
} |
|
||||
|
|
||||
public enum GestureRecognizerResult |
|
||||
{ |
|
||||
None, |
|
||||
Capture, |
|
||||
ReleaseCapture |
|
||||
} |
|
||||
} |
|
||||
Loading…
Reference in new issue