|
@@ -1,4 +1,6 @@
|
|
|
using Avalonia.Controls;
|
|
|
+using Avalonia.Input;
|
|
|
+using Avalonia.Interactivity;
|
|
|
using PicView.Avalonia.UI;
|
|
|
using PicView.Avalonia.ViewModels;
|
|
|
|
|
@@ -15,6 +17,7 @@ public partial class ClickArrowRight : UserControl
|
|
|
return;
|
|
|
}
|
|
|
PointerWheelChanged += async (_, e) => await ImageViewer.PreviewOnPointerWheelChanged(this, e);
|
|
|
+ AddHandler(PointerPressedEvent, ManagePointerPressed, RoutingStrategies.Tunnel);
|
|
|
PolyButton.Click += (_, _) =>
|
|
|
{
|
|
|
vm.MainWindow.IsClickArrowRightClicked = true;
|
|
@@ -22,4 +25,24 @@ public partial class ClickArrowRight : UserControl
|
|
|
};
|
|
|
};
|
|
|
}
|
|
|
+
|
|
|
+ private void ManagePointerPressed(object? sender, PointerPressedEventArgs e)
|
|
|
+ {
|
|
|
+ var props = e.Properties;
|
|
|
+
|
|
|
+ if (PolyButton.IsPointerOver)
|
|
|
+ {
|
|
|
+ if (props.IsRightButtonPressed)
|
|
|
+ {
|
|
|
+ DialogManager.AddNavigationDialog();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (props.IsRightButtonPressed)
|
|
|
+ {
|
|
|
+ UIHelper.ShowMainContextMenu();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|