Skip to content

Commit

Permalink
Fix multiple selection not removing all
Browse files Browse the repository at this point in the history
  • Loading branch information
Deadpikle committed Nov 7, 2024
1 parent b1db9b8 commit 7b107c0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion EasyBackup/Views/ExcludeFilesFolders.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<StackPanel Grid.Column="1" Grid.Row="2" Orientation="Vertical" Margin="5">
<Button Content="Add File" Margin="0,5,0,5" Command="{Binding AddFile}"/>
<Button Content="Add Folder" Margin="0,5,0,5" Command="{Binding AddFolder}"/>
<Button Content="Remove File/Folder" Margin="0,5,0,5" CommandParameter="{Binding ElementName=PathsDataGrid, Path=SelectedItems}"
<Button Content="Remove File/Folder(s)" Margin="0,5,0,5" CommandParameter="{Binding ElementName=PathsDataGrid, Path=SelectedItems}"
Command="{Binding RemoveItem}" IsEnabled="{Binding IsItemSelected}"/>
<Button Content="Remove All Items" Margin="0,5,0,5" Command="{Binding RemoveAllItems}"/>
</StackPanel>
Expand Down
4 changes: 2 additions & 2 deletions EasyBackupAvalonia/ViewModels/ExcludeFilesFoldersViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ private void RemoveItemFromList(object items)
if (items != null)
{
System.Collections.IList list = (System.Collections.IList)items;
var selection = list?.Cast<FolderFileItem>();
for (int i = 0; i < selection.Count(); i++)
var selection = list?.Cast<FolderFileItem>().ToArray();
for (int i = 0; i < selection.Length; i++)
{
Items.Remove(selection.ElementAt(i));
}
Expand Down
4 changes: 2 additions & 2 deletions EasyBackupAvalonia/ViewModels/SetupBackupViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ private void RemoveItemFromList(object items)
if (items != null)
{
System.Collections.IList list = (System.Collections.IList)items;
var selection = list?.Cast<FolderFileItem>();
for (int i = 0; i < selection.Count(); i++)
var selection = list?.Cast<FolderFileItem>().ToArray();
for (int i = 0; i < selection.Length; i++)
{
Items.Remove(selection.ElementAt(i));
}
Expand Down
2 changes: 1 addition & 1 deletion EasyBackupAvalonia/Views/SetupBackup.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
<Button Content="Add Folder"
Margin="0,5,0,5"
Command="{Binding AddFolder}" />
<Button Content="Remove File/Folder"
<Button Content="Remove File/Folder(s)"
Margin="0,5,0,5"
CommandParameter="{Binding ElementName=PathsDataGrid, Path=SelectedItems}"
Command="{Binding RemoveItem}"
Expand Down

0 comments on commit 7b107c0

Please sign in to comment.