From 09c9d7b7d516d30192e1fdefe45125023499cac0 Mon Sep 17 00:00:00 2001 From: Nikita Tsukanov Date: Wed, 7 Jun 2017 20:03:27 +0300 Subject: [PATCH] Layout integration seems to be working now --- src/Avalonia.Layout/LayoutManager.cs | 2 +- src/Avalonia.Layout/Layoutable.cs | 2 +- .../Avalonia.Win32.Interop/Wpf/WpfTopLevelImpl.cs | 10 ++-------- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/Avalonia.Layout/LayoutManager.cs b/src/Avalonia.Layout/LayoutManager.cs index b7b83bf852..93c2227cab 100644 --- a/src/Avalonia.Layout/LayoutManager.cs +++ b/src/Avalonia.Layout/LayoutManager.cs @@ -151,7 +151,7 @@ namespace Avalonia.Layout if (root != null) { - root.Arrange(new Rect(root.DesiredSize)); + root.Arrange(new Rect(root.ClientSize)); } else if (parent != null) { diff --git a/src/Avalonia.Layout/Layoutable.cs b/src/Avalonia.Layout/Layoutable.cs index 778a869003..3f6d789877 100644 --- a/src/Avalonia.Layout/Layoutable.cs +++ b/src/Avalonia.Layout/Layoutable.cs @@ -399,7 +399,7 @@ namespace Avalonia.Layout } /// - public virtual void ChildDesiredSizeChanged(ILayoutable control) + void ILayoutable.ChildDesiredSizeChanged(ILayoutable control) { if (!_measuring) { diff --git a/src/Windows/Avalonia.Win32.Interop/Wpf/WpfTopLevelImpl.cs b/src/Windows/Avalonia.Win32.Interop/Wpf/WpfTopLevelImpl.cs index 1aa09853ab..c990bb708e 100644 --- a/src/Windows/Avalonia.Win32.Interop/Wpf/WpfTopLevelImpl.cs +++ b/src/Windows/Avalonia.Win32.Interop/Wpf/WpfTopLevelImpl.cs @@ -40,10 +40,10 @@ namespace Avalonia.Win32.Interop.Wpf EnforceClientSize = false; } - public override void ChildDesiredSizeChanged(ILayoutable control) + public override void InvalidateMeasure() { ((FrameworkElement)PlatformImpl)?.InvalidateMeasure(); - base.ChildDesiredSizeChanged(control); + base.InvalidateMeasure(); } protected override void HandleResized(Size clientSize) @@ -52,12 +52,6 @@ namespace Avalonia.Win32.Interop.Wpf LayoutManager.Instance.ExecuteLayoutPass(); Renderer?.Resized(clientSize); } - - protected override void ArrangeCore(Rect finalRect) - { - base.ArrangeOverride(finalRect.Size); - Bounds = finalRect; - } } public WpfTopLevelImpl()