|
|
|
@ -46,18 +46,6 @@ public partial class LaunchViewModel : ObservableObject
|
|
|
|
|
public LaunchViewModel(ISettingsManager settingsManager) |
|
|
|
|
{ |
|
|
|
|
this.settingsManager = settingsManager; |
|
|
|
|
Packages.CollectionChanged += PackagesOnCollectionChanged; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void PackagesOnCollectionChanged(object? sender, NotifyCollectionChangedEventArgs e) |
|
|
|
|
{ |
|
|
|
|
if (e.Action != NotifyCollectionChangedAction.Add) return; |
|
|
|
|
|
|
|
|
|
var newPackage = e.NewItems?.Cast<InstalledPackage>().FirstOrDefault(); |
|
|
|
|
if (newPackage != null) |
|
|
|
|
{ |
|
|
|
|
settingsManager.AddInstalledPackage(newPackage); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public AsyncRelayCommand LaunchCommand => new(async () => |
|
|
|
|