From f25e0b3d023f133304d1c3b67a6ef3968cc1654c Mon Sep 17 00:00:00 2001 From: robloo Date: Sat, 18 Feb 2023 19:51:17 -0500 Subject: [PATCH] Use SetCurrentValue() in TreeViewItem --- src/Avalonia.Controls/TreeViewItem.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Avalonia.Controls/TreeViewItem.cs b/src/Avalonia.Controls/TreeViewItem.cs index 9f8e3e38c0f..e9abfef6730 100644 --- a/src/Avalonia.Controls/TreeViewItem.cs +++ b/src/Avalonia.Controls/TreeViewItem.cs @@ -190,7 +190,7 @@ static bool ExpandItem(TreeViewItem treeViewItem) { if (treeViewItem.ItemCount > 0 && !treeViewItem.IsExpanded) { - treeViewItem.IsExpanded = true; + treeViewItem.SetCurrentValue(IsExpandedProperty, true); return true; } @@ -201,7 +201,7 @@ static bool CollapseItem(TreeViewItem treeViewItem) { if (treeViewItem.ItemCount > 0 && treeViewItem.IsExpanded) { - treeViewItem.IsExpanded = false; + treeViewItem.SetCurrentValue(IsExpandedProperty, false); return true; } @@ -214,7 +214,7 @@ static bool FocusAwareCollapseItem(TreeViewItem treeViewItem) { if (treeViewItem.IsFocused) { - treeViewItem.IsExpanded = false; + treeViewItem.SetCurrentValue(IsExpandedProperty, false); } else { @@ -265,7 +265,7 @@ protected virtual void OnHeaderDoubleTapped(TappedEventArgs e) { if (ItemCount > 0) { - IsExpanded = !IsExpanded; + SetCurrentValue(IsExpandedProperty, !IsExpanded); e.Handled = true; } }