From 7361ece12a48c3efb2f5a93c55be2f58e73d8ba5 Mon Sep 17 00:00:00 2001 From: Edward Miller Date: Tue, 26 Dec 2023 23:57:46 -0600 Subject: [PATCH] don't use closure --- Maui.DataGrid/DataGrid.xaml.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Maui.DataGrid/DataGrid.xaml.cs b/Maui.DataGrid/DataGrid.xaml.cs index d9d553f..e085c7c 100644 --- a/Maui.DataGrid/DataGrid.xaml.cs +++ b/Maui.DataGrid/DataGrid.xaml.cs @@ -1060,7 +1060,7 @@ private View GetHeaderViewForColumn(DataGridColumn column) { new TapGestureRecognizer { - Command = new Command(() => + Command = new Command(column => { // This is to invert SortOrder when the user taps on a column. var order = column.SortingOrder == SortingOrder.Ascendant @@ -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 } } };