diff --git a/src/Dock.Avalonia/Internal/DockControlState.cs b/src/Dock.Avalonia/Internal/DockControlState.cs index 91fcf9392..3b90c213f 100644 --- a/src/Dock.Avalonia/Internal/DockControlState.cs +++ b/src/Dock.Avalonia/Internal/DockControlState.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using Avalonia; using Avalonia.Controls; -using Avalonia.Input; using Avalonia.VisualTree; using Dock.Avalonia.Controls; using Dock.Model.Core; @@ -141,6 +140,11 @@ private void Execute(Point point, DockOperation operation, DragAction dragAction { if (sourceDockable is IDock dock) { + if (dock.ActiveDockable == null) + { + return; + } + sourceDockable = dock.ActiveDockable; } diff --git a/tests/Dock.Avalonia.UnitTests/Controls/ProportionalStackPanelTests.cs b/tests/Dock.Avalonia.UnitTests/Controls/ProportionalStackPanelTests.cs index cd705fcbb..b997a3d60 100644 --- a/tests/Dock.Avalonia.UnitTests/Controls/ProportionalStackPanelTests.cs +++ b/tests/Dock.Avalonia.UnitTests/Controls/ProportionalStackPanelTests.cs @@ -60,7 +60,7 @@ public void Lays_Out_Children_Vertical() Assert.Equal(new Rect(0, 152, 100, 148), target.Children[2].Bounds); } - private static IEnumerable GetBorderTestsData() + public static IEnumerable GetBorderTestsData() { yield return [0.5, 604, 300, 300]; yield return [0.25, 604, 150, 450]; diff --git a/tests/Dock.Model.Mvvm.UnitTests/FactoryTests.cs b/tests/Dock.Model.Mvvm.UnitTests/FactoryTests.cs index b8fa46692..0c3987990 100644 --- a/tests/Dock.Model.Mvvm.UnitTests/FactoryTests.cs +++ b/tests/Dock.Model.Mvvm.UnitTests/FactoryTests.cs @@ -22,7 +22,7 @@ public void CreateList_Creates_ReactiveList_Empty() var actual = factory.CreateList(); Assert.NotNull(actual); Assert.IsType>(actual); - Assert.Equal(0, actual.Count); + Assert.Empty(actual); } [Fact] diff --git a/tests/Dock.Model.ReactiveUI.UnitTests/FactoryTests.cs b/tests/Dock.Model.ReactiveUI.UnitTests/FactoryTests.cs index 61852a3f7..289c1c78b 100644 --- a/tests/Dock.Model.ReactiveUI.UnitTests/FactoryTests.cs +++ b/tests/Dock.Model.ReactiveUI.UnitTests/FactoryTests.cs @@ -22,7 +22,7 @@ public void CreateList_Creates_ReactiveList_Empty() var actual = factory.CreateList(); Assert.NotNull(actual); Assert.IsType>(actual); - Assert.Equal(0, actual.Count); + Assert.Empty(actual); } [Fact] @@ -101,4 +101,4 @@ public void CreateLayout_Creates_RootDock() public class TestFactory : Factory { -} \ No newline at end of file +}