Skip to content

Commit b49c951

Browse files
authored
fixed select all button action
1 parent e2db713 commit b49c951

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/TableViewHeaderRow.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
using CommunityToolkit.WinUI;
21
using Microsoft.UI;
32
using Microsoft.UI.Xaml;
43
using Microsoft.UI.Xaml.Controls;
54
using Microsoft.UI.Xaml.Data;
5+
using Microsoft.UI.Xaml.Input;
66
using Microsoft.UI.Xaml.Media;
77
using Microsoft.UI.Xaml.Shapes;
88
using System;
@@ -62,7 +62,7 @@ protected override void OnApplyTemplate()
6262

6363
if (GetTemplateChild("selectAllButton") is Button selectAllButton)
6464
{
65-
selectAllButton.Tapped += delegate { TableView.SelectAllSafe(); };
65+
selectAllButton.Tapped += OnSelectAllButtonClicked;
6666
}
6767

6868
if (_selectAllCheckBox is not null)
@@ -375,12 +375,20 @@ private void SetSelectAllButtonState()
375375
}
376376
}
377377

378+
/// <summary>
379+
/// Handles the SelectAllButton clicked event.
380+
/// </summary>
381+
private void OnSelectAllButtonClicked(object sender, TappedRoutedEventArgs e)
382+
{
383+
TableView?.SelectAll();
384+
}
385+
378386
/// <summary>
379387
/// Handles the Checked event for the select all checkbox.
380388
/// </summary>
381389
private void OnSelectAllCheckBoxChecked(object sender, RoutedEventArgs e)
382390
{
383-
TableView?.SelectAllSafe();
391+
TableView?.SelectAll();
384392
}
385393

386394
/// <summary>

0 commit comments

Comments
 (0)