Skip to content

Commit

Permalink
don't use closure
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward Miller committed Dec 27, 2023
1 parent 4dd1ec9 commit 7361ece
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Maui.DataGrid/DataGrid.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ private View GetHeaderViewForColumn(DataGridColumn column)
{
new TapGestureRecognizer
{
Command = new Command(() =>
Command = new Command<DataGridColumn>(column =>
{
// This is to invert SortOrder when the user taps on a column.
var order = column.SortingOrder == SortingOrder.Ascendant
Expand All @@ -1072,7 +1072,9 @@ private View GetHeaderViewForColumn(DataGridColumn column)
SortedColumnIndex = new(index, order);

column.SortingOrder = order;
}, () => column.SortingEnabled && Columns.Contains(column))
},
column => column.SortingEnabled && Columns.Contains(column)),
CommandParameter = column
}
}
};
Expand Down

0 comments on commit 7361ece

Please sign in to comment.