Browse Source

auto-pick the first list item if it exists

pull/5/head
JT 2 years ago
parent
commit
506e9df72e
  1. 6
      StabilityMatrix/ViewModels/InstallerViewModel.cs
  2. 4
      StabilityMatrix/ViewModels/LaunchViewModel.cs

6
StabilityMatrix/ViewModels/InstallerViewModel.cs

@ -128,14 +128,16 @@ public class InstallerViewModel : INotifyPropertyChanged
if (settingsManager.Settings.InstalledPackages.FirstOrDefault(x => x.PackageName == SelectedPackage.Name) == if (settingsManager.Settings.InstalledPackages.FirstOrDefault(x => x.PackageName == SelectedPackage.Name) ==
null) null)
{ {
settingsManager.AddInstalledPackage(new InstalledPackage var package = new InstalledPackage
{ {
Name = SelectedPackage.Name, Name = SelectedPackage.Name,
Path = SelectedPackage.InstallLocation, Path = SelectedPackage.InstallLocation,
Id = Guid.NewGuid(), Id = Guid.NewGuid(),
PackageName = SelectedPackage.Name, PackageName = SelectedPackage.Name,
PackageVersion = "idklol" PackageVersion = "idklol"
}); };
settingsManager.AddInstalledPackage(package);
settingsManager.SetActiveInstalledPackage(package);
} }
}); });

4
StabilityMatrix/ViewModels/LaunchViewModel.cs

@ -97,6 +97,10 @@ public partial class LaunchViewModel : ObservableObject
public void OnLoaded() public void OnLoaded()
{ {
LoadPackages(); LoadPackages();
if (InstalledPackages.Any())
{
SelectedPackage = InstalledPackages[0];
}
} }
private void LoadPackages() private void LoadPackages()

Loading…
Cancel
Save