Browse Source

HeaderDoubleTapped in TreeViewItem is now protected virtual instead of private

pull/10022/head
cristinathoughtpennies 4 years ago
parent
commit
f2908c6c79
  1. 18
      src/Avalonia.Controls/TreeViewItem.cs

18
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<T>(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;
}
}
}
}

Loading…
Cancel
Save