Skip to content

Commit efca8c5

Browse files
Requested changes
1 parent 5acec20 commit efca8c5

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

src/Files.App/Views/Layouts/DetailsLayoutPage.xaml.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -884,18 +884,18 @@ private void ItemSelected_Checked(object sender, RoutedEventArgs e)
884884

885885
private void ItemSelected_Unchecked(object sender, RoutedEventArgs e)
886886
{
887-
if (sender is CheckBox checkBox)
888-
{
889-
if (checkBox.DataContext is ListedItem item && FileList.SelectedItems.Contains(item))
890-
FileList.SelectedItems.Remove(item);
891-
892-
// Workaround for #17298
893-
checkBox.IsTabStop = false;
894-
checkBox.IsEnabled = false;
895-
checkBox.IsEnabled = true;
896-
checkBox.IsTabStop = true;
897-
FileList.Focus(FocusState.Programmatic);
898-
}
887+
if (sender is not CheckBox checkBox)
888+
return;
889+
890+
if (checkBox.DataContext is ListedItem item && FileList.SelectedItems.Contains(item))
891+
FileList.SelectedItems.Remove(item);
892+
893+
// Workaround for #17298
894+
checkBox.IsTabStop = false;
895+
checkBox.IsEnabled = false;
896+
checkBox.IsEnabled = true;
897+
checkBox.IsTabStop = true;
898+
FileList.Focus(FocusState.Programmatic);
899899
}
900900

901901
private new void FileList_ContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)

src/Files.App/Views/Layouts/GridLayoutPage.xaml.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -670,18 +670,18 @@ checkBox.DataContext is ListedItem item &&
670670

671671
private void ItemSelected_Unchecked(object sender, RoutedEventArgs e)
672672
{
673-
if (sender is CheckBox checkBox)
674-
{
675-
if (checkBox.DataContext is ListedItem item && FileList.SelectedItems.Contains(item))
676-
FileList.SelectedItems.Remove(item);
673+
if (sender is not CheckBox checkBox)
674+
return;
677675

678-
// Workaround for #17298
679-
checkBox.IsTabStop = false;
680-
checkBox.IsEnabled = false;
681-
checkBox.IsEnabled = true;
682-
checkBox.IsTabStop = true;
683-
FileList.Focus(FocusState.Programmatic);
684-
}
676+
if (checkBox.DataContext is ListedItem item && FileList.SelectedItems.Contains(item))
677+
FileList.SelectedItems.Remove(item);
678+
679+
// Workaround for #17298
680+
checkBox.IsTabStop = false;
681+
checkBox.IsEnabled = false;
682+
checkBox.IsEnabled = true;
683+
checkBox.IsTabStop = true;
684+
FileList.Focus(FocusState.Programmatic);
685685
}
686686

687687
private new void FileList_ContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)

0 commit comments

Comments
 (0)