|
@@ -2,6 +2,7 @@ using System;
|
|
using System.Runtime.InteropServices;
|
|
using System.Runtime.InteropServices;
|
|
using Avalonia;
|
|
using Avalonia;
|
|
using Avalonia.Controls;
|
|
using Avalonia.Controls;
|
|
|
|
+using Avalonia.Input;
|
|
using Avalonia.Interactivity;
|
|
using Avalonia.Interactivity;
|
|
using Avalonia.Threading;
|
|
using Avalonia.Threading;
|
|
|
|
|
|
@@ -32,6 +33,8 @@ namespace IntegrationTestApp
|
|
private readonly TextBox? _orderTextBox;
|
|
private readonly TextBox? _orderTextBox;
|
|
private int _mouseMoveCount;
|
|
private int _mouseMoveCount;
|
|
private int _mouseReleaseCount;
|
|
private int _mouseReleaseCount;
|
|
|
|
+ private int _doubleClickCount;
|
|
|
|
+ private int _mouseDownCount;
|
|
|
|
|
|
public ShowWindowTest()
|
|
public ShowWindowTest()
|
|
{
|
|
{
|
|
@@ -40,8 +43,10 @@ namespace IntegrationTestApp
|
|
PositionChanged += (s, e) => CurrentPosition.Text = $"{Position}";
|
|
PositionChanged += (s, e) => CurrentPosition.Text = $"{Position}";
|
|
|
|
|
|
PointerMoved += OnPointerMoved;
|
|
PointerMoved += OnPointerMoved;
|
|
|
|
+ PointerPressed += OnPointerPressed;
|
|
PointerReleased += OnPointerReleased;
|
|
PointerReleased += OnPointerReleased;
|
|
PointerExited += (_, e) => ResetCounters();
|
|
PointerExited += (_, e) => ResetCounters();
|
|
|
|
+ DoubleTapped += OnDoubleTapped;
|
|
|
|
|
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
|
{
|
|
{
|
|
@@ -87,6 +92,12 @@ namespace IntegrationTestApp
|
|
UpdateCounterDisplays();
|
|
UpdateCounterDisplays();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void OnPointerPressed(object? sender, Avalonia.Input.PointerPressedEventArgs e)
|
|
|
|
+ {
|
|
|
|
+ _mouseDownCount++;
|
|
|
|
+ UpdateCounterDisplays();
|
|
|
|
+ }
|
|
|
|
+
|
|
private void OnPointerReleased(object? sender, Avalonia.Input.PointerReleasedEventArgs e)
|
|
private void OnPointerReleased(object? sender, Avalonia.Input.PointerReleasedEventArgs e)
|
|
{
|
|
{
|
|
_mouseReleaseCount++;
|
|
_mouseReleaseCount++;
|
|
@@ -97,19 +108,35 @@ namespace IntegrationTestApp
|
|
{
|
|
{
|
|
_mouseMoveCount = 0;
|
|
_mouseMoveCount = 0;
|
|
_mouseReleaseCount = 0;
|
|
_mouseReleaseCount = 0;
|
|
|
|
+ _doubleClickCount = 0;
|
|
|
|
+ _mouseDownCount = 0;
|
|
|
|
+ UpdateCounterDisplays();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void OnDoubleTapped(object? sender, Avalonia.Input.TappedEventArgs e)
|
|
|
|
+ {
|
|
|
|
+ _doubleClickCount++;
|
|
UpdateCounterDisplays();
|
|
UpdateCounterDisplays();
|
|
}
|
|
}
|
|
|
|
|
|
private void UpdateCounterDisplays()
|
|
private void UpdateCounterDisplays()
|
|
{
|
|
{
|
|
var mouseMoveCountTextBox = this.FindControl<TextBox>("MouseMoveCount");
|
|
var mouseMoveCountTextBox = this.FindControl<TextBox>("MouseMoveCount");
|
|
|
|
+ var mouseDownCountTextBox = this.FindControl<TextBox>("MouseDownCount");
|
|
var mouseReleaseCountTextBox = this.FindControl<TextBox>("MouseReleaseCount");
|
|
var mouseReleaseCountTextBox = this.FindControl<TextBox>("MouseReleaseCount");
|
|
|
|
+ var doubleClickCountTextBox = this.FindControl<TextBox>("DoubleClickCount");
|
|
|
|
|
|
if (mouseMoveCountTextBox != null)
|
|
if (mouseMoveCountTextBox != null)
|
|
mouseMoveCountTextBox.Text = _mouseMoveCount.ToString();
|
|
mouseMoveCountTextBox.Text = _mouseMoveCount.ToString();
|
|
|
|
|
|
|
|
+ if (mouseDownCountTextBox != null)
|
|
|
|
+ mouseDownCountTextBox.Text = _mouseDownCount.ToString();
|
|
|
|
+
|
|
if (mouseReleaseCountTextBox != null)
|
|
if (mouseReleaseCountTextBox != null)
|
|
mouseReleaseCountTextBox.Text = _mouseReleaseCount.ToString();
|
|
mouseReleaseCountTextBox.Text = _mouseReleaseCount.ToString();
|
|
|
|
+
|
|
|
|
+ if (doubleClickCountTextBox != null)
|
|
|
|
+ doubleClickCountTextBox.Text = _doubleClickCount.ToString();
|
|
}
|
|
}
|
|
|
|
|
|
public void ShowTitleAreaControl()
|
|
public void ShowTitleAreaControl()
|