Skip to content

Commit

Permalink
Merge pull request #10395 from robloo/treeviewitem-setcurrentvalue
Browse files Browse the repository at this point in the history
Use SetCurrentValue() in TreeViewItem
  • Loading branch information
maxkatz6 authored Feb 19, 2023
2 parents c6009b4 + f25e0b3 commit 4498604
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Avalonia.Controls/TreeViewItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ static bool ExpandItem(TreeViewItem treeViewItem)
{
if (treeViewItem.ItemCount > 0 && !treeViewItem.IsExpanded)
{
treeViewItem.IsExpanded = true;
treeViewItem.SetCurrentValue(IsExpandedProperty, true);
return true;
}

Expand All @@ -201,7 +201,7 @@ static bool CollapseItem(TreeViewItem treeViewItem)
{
if (treeViewItem.ItemCount > 0 && treeViewItem.IsExpanded)
{
treeViewItem.IsExpanded = false;
treeViewItem.SetCurrentValue(IsExpandedProperty, false);
return true;
}

Expand All @@ -214,7 +214,7 @@ static bool FocusAwareCollapseItem(TreeViewItem treeViewItem)
{
if (treeViewItem.IsFocused)
{
treeViewItem.IsExpanded = false;
treeViewItem.SetCurrentValue(IsExpandedProperty, false);
}
else
{
Expand Down Expand Up @@ -265,7 +265,7 @@ protected virtual void OnHeaderDoubleTapped(TappedEventArgs e)
{
if (ItemCount > 0)
{
IsExpanded = !IsExpanded;
SetCurrentValue(IsExpandedProperty, !IsExpanded);
e.Handled = true;
}
}
Expand Down

0 comments on commit 4498604

Please sign in to comment.