|
|
@ -4,6 +4,7 @@ using System.ComponentModel; |
|
|
|
using System.Diagnostics; |
|
|
|
using System.Diagnostics; |
|
|
|
using System.Linq; |
|
|
|
using System.Linq; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using System.Threading.Tasks; |
|
|
|
|
|
|
|
using Avalonia.Controls; |
|
|
|
using Avalonia.Threading; |
|
|
|
using Avalonia.Threading; |
|
|
|
using AvaloniaEdit.Document; |
|
|
|
using AvaloniaEdit.Document; |
|
|
|
using CommunityToolkit.Mvvm.ComponentModel; |
|
|
|
using CommunityToolkit.Mvvm.ComponentModel; |
|
|
@ -85,29 +86,6 @@ public partial class LaunchPageViewModel : PageViewModelBase |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void OnLoaded() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (Design.IsDesignMode) return; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LoadPackages(); |
|
|
|
|
|
|
|
lock (InstalledPackages) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// Skip if no packages |
|
|
|
|
|
|
|
if (!InstalledPackages.Any()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
//logger.LogTrace($"No packages for {nameof(LaunchViewModel)}"); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var activePackageId = settingsManager.Settings.ActiveInstalledPackage; |
|
|
|
|
|
|
|
if (activePackageId != null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
SelectedPackage = InstalledPackages.FirstOrDefault( |
|
|
|
|
|
|
|
x => x.Id == activePackageId) ?? InstalledPackages[0]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[RelayCommand] |
|
|
|
[RelayCommand] |
|
|
|
private async Task LaunchAsync() |
|
|
|
private async Task LaunchAsync() |
|
|
|
{ |
|
|
|
{ |
|
|
|