From f2908c6c79075bdbeb6a3b19a72a789f4245289b Mon Sep 17 00:00:00 2001 From: cristinathoughtpennies Date: Thu, 19 Jan 2023 10:56:24 -0600 Subject: [PATCH] HeaderDoubleTapped in TreeViewItem is now protected virtual instead of private --- src/Avalonia.Controls/TreeViewItem.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Avalonia.Controls/TreeViewItem.cs b/src/Avalonia.Controls/TreeViewItem.cs index fb20a7ee14..532d0e32db 100644 --- a/src/Avalonia.Controls/TreeViewItem.cs +++ b/src/Avalonia.Controls/TreeViewItem.cs @@ -264,6 +264,15 @@ namespace Avalonia.Controls Dispatcher.UIThread.Post(this.BringIntoView); // must use the Dispatcher, otherwise the TreeView doesn't scroll } } + + protected virtual void HeaderDoubleTapped(object? sender, TappedEventArgs e) + { + if (ItemCount > 0) + { + IsExpanded = !IsExpanded; + e.Handled = true; + } + } private static int CalculateDistanceFromLogicalParent(ILogical? logical, int @default = -1) where T : class { @@ -277,14 +286,5 @@ namespace Avalonia.Controls return logical != null ? result : @default; } - - private void HeaderDoubleTapped(object? sender, TappedEventArgs e) - { - if (ItemCount > 0) - { - IsExpanded = !IsExpanded; - e.Handled = true; - } - } } }