mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-11-19 09:21:15 +01:00
UI: Fix XCI file trimmer selection crash
This commit is contained in:
1 parent
52c6a1890e
commit
fc4c45ef1d
1 file changed
+9
-10
@@ -6,6 +6,8 @@ using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.Ava.UI.ViewModels;
|
||||
using Ryujinx.UI.Common.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ryujinx.Ava.UI.Windows
|
||||
@@ -81,20 +83,17 @@ namespace Ryujinx.Ava.UI.Windows
|
||||
|
||||
private void OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
foreach (object content in e.AddedItems)
|
||||
List<XCITrimmerFileModel> added = [.. e.AddedItems.OfType<XCITrimmerFileModel>()];
|
||||
List<XCITrimmerFileModel> removed = [.. e.RemovedItems.OfType<XCITrimmerFileModel>()];
|
||||
|
||||
foreach (XCITrimmerFileModel applicationData in added)
|
||||
{
|
||||
if (content is XCITrimmerFileModel applicationData)
|
||||
{
|
||||
ViewModel.Select(applicationData);
|
||||
}
|
||||
ViewModel.Select(applicationData);
|
||||
}
|
||||
|
||||
foreach (object content in e.RemovedItems)
|
||||
foreach (XCITrimmerFileModel applicationData in removed)
|
||||
{
|
||||
if (content is XCITrimmerFileModel applicationData)
|
||||
{
|
||||
ViewModel.Deselect(applicationData);
|
||||
}
|
||||
ViewModel.Deselect(applicationData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user