|
|
@ -4,8 +4,10 @@ using System.Collections.ObjectModel; |
|
|
|
using System.IO; |
|
|
|
using System.IO; |
|
|
|
using System.Linq; |
|
|
|
using System.Linq; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using System.Threading.Tasks; |
|
|
|
|
|
|
|
using AsyncAwaitBestPractices; |
|
|
|
using Avalonia.Controls; |
|
|
|
using Avalonia.Controls; |
|
|
|
using Avalonia.Controls.Notifications; |
|
|
|
using Avalonia.Controls.Notifications; |
|
|
|
|
|
|
|
using Avalonia.Threading; |
|
|
|
using CommunityToolkit.Mvvm.ComponentModel; |
|
|
|
using CommunityToolkit.Mvvm.ComponentModel; |
|
|
|
using CommunityToolkit.Mvvm.Input; |
|
|
|
using CommunityToolkit.Mvvm.Input; |
|
|
|
using FluentAvalonia.UI.Controls; |
|
|
|
using FluentAvalonia.UI.Controls; |
|
|
@ -68,7 +70,7 @@ public partial class PackageManagerViewModel : PageViewModelBase |
|
|
|
[ObservableProperty] |
|
|
|
[ObservableProperty] |
|
|
|
private string progressText = string.Empty; |
|
|
|
private string progressText = string.Empty; |
|
|
|
|
|
|
|
|
|
|
|
[ObservableProperty] |
|
|
|
[ObservableProperty, NotifyPropertyChangedFor(nameof(ProgressBarVisibility))] |
|
|
|
private bool isIndeterminate; |
|
|
|
private bool isIndeterminate; |
|
|
|
|
|
|
|
|
|
|
|
[ObservableProperty] |
|
|
|
[ObservableProperty] |
|
|
@ -324,11 +326,17 @@ public partial class PackageManagerViewModel : PageViewModelBase |
|
|
|
errorMsg, NotificationType.Error)); |
|
|
|
errorMsg, NotificationType.Error)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ProgressText = "Update complete"; |
|
|
|
ProgressText = string.Empty; |
|
|
|
|
|
|
|
ProgressValue = 0; |
|
|
|
|
|
|
|
IsIndeterminate = false; |
|
|
|
|
|
|
|
|
|
|
|
SelectedPackage.UpdateAvailable = false; |
|
|
|
SelectedPackage.UpdateAvailable = false; |
|
|
|
UpdateAvailable = false; |
|
|
|
UpdateAvailable = false; |
|
|
|
|
|
|
|
|
|
|
|
settingsManager.UpdatePackageVersionNumber(SelectedPackage.Id, updateResult); |
|
|
|
settingsManager.UpdatePackageVersionNumber(SelectedPackage.Id, updateResult); |
|
|
|
|
|
|
|
notificationService.Show("Update complete", |
|
|
|
|
|
|
|
$"{SelectedPackage.DisplayName} has been updated to the latest version.", |
|
|
|
|
|
|
|
NotificationType.Success); |
|
|
|
await OnLoadedAsync(); |
|
|
|
await OnLoadedAsync(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -352,7 +360,11 @@ public partial class PackageManagerViewModel : PageViewModelBase |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
viewModel.PackageInstalled += (_, _) => dialog.Hide(); |
|
|
|
viewModel.PackageInstalled += async (_, _) => |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
dialog.Hide(); |
|
|
|
|
|
|
|
await OnLoadedAsync(); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
await dialog.ShowAsync(); |
|
|
|
await dialog.ShowAsync(); |
|
|
|
} |
|
|
|
} |
|
|
|