55using NexusMods . Abstractions . Loadouts ;
66using NexusMods . Abstractions . Loadouts . Extensions ;
77using NexusMods . Abstractions . Collections ;
8+ using NexusMods . Abstractions . Loadouts . Synchronizers ;
89using NexusMods . App . UI . Controls . Navigation ;
910using NexusMods . App . UI . Helpers ;
1011using NexusMods . App . UI . Resources ;
@@ -28,7 +29,8 @@ public class CollectionLeftMenuItemViewModel : LeftMenuItemViewModel, ILeftMenuI
2829 public ReactiveCommand < Unit , Unit > ToggleIsEnabledCommand { get ; }
2930
3031 public CollectionGroupId CollectionGroupId { get ; }
31-
32+
33+ private readonly IServiceProvider _serviceProvider ;
3234 private readonly IConnection _connection ;
3335 private readonly IWorkspaceController _workspaceController ;
3436 private readonly bool _isNexusCollection ;
@@ -41,6 +43,7 @@ public CollectionLeftMenuItemViewModel(
4143 IServiceProvider serviceProvider ,
4244 CollectionGroupId collectionGroupId ) : base ( workspaceController , workspaceId , pageData )
4345 {
46+ _serviceProvider = serviceProvider ;
4447 _connection = serviceProvider . GetRequiredService < IConnection > ( ) ;
4548 _toastNotificationService = serviceProvider . GetRequiredService < IWindowNotificationService > ( ) ;
4649 _workspaceController = workspaceController ;
@@ -119,7 +122,11 @@ private ReactiveCommand<Unit, Unit> CreateDeleteCommand()
119122
120123 return ReactiveCommand . CreateFromTask ( async ( ) =>
121124 {
122- await CollectionDeleteHelpers . DeleteCollectionAsync ( CollectionGroupId , _workspaceController , _connection ,
125+ await CollectionDeleteHelpers . DeleteCollectionAsync (
126+ CollectionGroupId ,
127+ _serviceProvider . GetRequiredService < ILoadoutManager > ( ) ,
128+ _workspaceController ,
129+ _connection ,
123130 _toastNotificationService ) ;
124131 } , canExecute : canExecute ) ;
125132 }
0 commit comments