From 88446b1e9ead00ad4a8178981e3670d7100eeebc Mon Sep 17 00:00:00 2001 From: Jumar Macato Date: Mon, 14 Oct 2019 17:33:14 +0800 Subject: [PATCH 1/2] Pass PointerPressed event to BeginModeDrag and BeginResizeDrag. --- samples/ControlCatalog/DecoratedWindow.xaml.cs | 11 ++++++----- src/Avalonia.Controls/Platform/IWindowImpl.cs | 13 +++++++------ src/Avalonia.Controls/Window.cs | 4 ++-- .../Remote/PreviewerWindowImpl.cs | 5 +++-- src/Avalonia.DesignerSupport/Remote/Stubs.cs | 14 +++++++------- src/Avalonia.Native/WindowImplBase.cs | 4 ++-- src/Avalonia.X11/X11Window.cs | 12 +++++++----- src/Windows/Avalonia.Win32/WindowImpl.cs | 4 ++-- 8 files changed, 36 insertions(+), 31 deletions(-) diff --git a/samples/ControlCatalog/DecoratedWindow.xaml.cs b/samples/ControlCatalog/DecoratedWindow.xaml.cs index 2e7218b956..d76ef0a7bf 100644 --- a/samples/ControlCatalog/DecoratedWindow.xaml.cs +++ b/samples/ControlCatalog/DecoratedWindow.xaml.cs @@ -18,18 +18,18 @@ namespace ControlCatalog { var ctl = this.FindControl(name); ctl.Cursor = new Cursor(cursor); - ctl.PointerPressed += delegate + ctl.PointerPressed += (i, e) => { - PlatformImpl?.BeginResizeDrag(edge); + PlatformImpl?.BeginResizeDrag(edge, e); }; } private void InitializeComponent() { AvaloniaXamlLoader.Load(this); - this.FindControl("TitleBar").PointerPressed += delegate + this.FindControl("TitleBar").PointerPressed += (i, e) => { - PlatformImpl?.BeginMoveDrag(); + PlatformImpl?.BeginMoveDrag(e); }; SetupSide("Left", StandardCursorType.LeftSide, WindowEdge.West); SetupSide("Right", StandardCursorType.RightSide, WindowEdge.East); @@ -39,7 +39,8 @@ namespace ControlCatalog SetupSide("TopRight", StandardCursorType.TopRightCorner, WindowEdge.NorthEast); SetupSide("BottomLeft", StandardCursorType.BottomLeftCorner, WindowEdge.SouthWest); SetupSide("BottomRight", StandardCursorType.BottomRightCorner, WindowEdge.SouthEast); - this.FindControl