From 9e7c4d1b0943f10a600d03a8722bb19407e92337 Mon Sep 17 00:00:00 2001 From: ShadowDancer Date: Wed, 2 Sep 2020 23:20:01 +0200 Subject: [PATCH 1/2] Update Visual.cs documentation `OnAttachedToVisualTree`/`OnDetachedFromVisualTree` is called only for root visual tree. Keep xmldoc in line with event description. --- src/Avalonia.Visuals/Visual.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Avalonia.Visuals/Visual.cs b/src/Avalonia.Visuals/Visual.cs index cd6eb6aac7..283d9deb52 100644 --- a/src/Avalonia.Visuals/Visual.cs +++ b/src/Avalonia.Visuals/Visual.cs @@ -455,7 +455,7 @@ namespace Avalonia } /// - /// Called when the control is added to a visual tree. + /// Called when the control is added to a rooted visual tree. /// /// The event args. protected virtual void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e) @@ -463,7 +463,7 @@ namespace Avalonia } /// - /// Called when the control is removed from a visual tree. + /// Called when the control is removed from a rooted visual tree. /// /// The event args. protected virtual void OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs e) From 126737fd1bd5d182bdf803adfa7de949b77be0a1 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Fri, 4 Sep 2020 18:04:06 +0200 Subject: [PATCH 2/2] Update ScrollBar visibility with local value priority. Using `SetValue` with `Style` priority caused a new entry to be added to the `IsVisible` priority store each time the value was updated, causing a leak. Setting it with local value priority subtly changes its semantics but hopefully not so that anyone notices. --- src/Avalonia.Controls/Primitives/ScrollBar.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Avalonia.Controls/Primitives/ScrollBar.cs b/src/Avalonia.Controls/Primitives/ScrollBar.cs index fc82fcc7a7..477d24dc99 100644 --- a/src/Avalonia.Controls/Primitives/ScrollBar.cs +++ b/src/Avalonia.Controls/Primitives/ScrollBar.cs @@ -141,7 +141,7 @@ namespace Avalonia.Controls.Primitives _ => throw new InvalidOperationException("Invalid value for ScrollBar.Visibility.") }; - SetValue(IsVisibleProperty, isVisible, BindingPriority.Style); + SetValue(IsVisibleProperty, isVisible); } protected override void OnKeyDown(KeyEventArgs e)