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) ==
null)
{
settingsManager.AddInstalledPackage(new InstalledPackage
var package = new InstalledPackage
{
Name = SelectedPackage.Name,
Path = SelectedPackage.InstallLocation,
Id = Guid.NewGuid(),
PackageName = SelectedPackage.Name,
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()
{
LoadPackages();
if (InstalledPackages.Any())
{
SelectedPackage = InstalledPackages[0];
}
}
private void LoadPackages()

Loading…
Cancel
Save