From 6f1d12a0e4259ded9397ae65468009e456cfc621 Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Fri, 29 Nov 2019 16:01:17 -0700 Subject: [PATCH] Fix progress bar updating in the Metadata VMs --- Wabbajack/View Models/ModListMetadataVM.cs | 14 +++++++++++++- Wabbajack/Views/ModeSelectionView.xaml | 18 +++++++++++++----- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/Wabbajack/View Models/ModListMetadataVM.cs b/Wabbajack/View Models/ModListMetadataVM.cs index ccaf4026..3b47d536 100644 --- a/Wabbajack/View Models/ModListMetadataVM.cs +++ b/Wabbajack/View Models/ModListMetadataVM.cs @@ -64,11 +64,13 @@ namespace Wabbajack.View_Models IsDownloading = true; var queue = new WorkQueue(1); - var sub = queue.Status.Select(i => i.ProgressPercent).ToProperty(this, x => x.DownloadProgress); + DownloadStatusText = "Downloading"; + var sub = queue.Status.Select(i => i.ProgressPercent).Subscribe(v => DownloadProgress = v); queue.QueueTask(() => { var downloader = DownloadDispatcher.ResolveArchive(Metadata.Links.Download); downloader.Download(new Archive{ Name = Metadata.Title, Size = Metadata.DownloadMetadata?.Size ?? 0}, Location); + DownloadStatusText = "Hashing"; Location.FileHashCached(); IsDownloading = false; sub.Dispose(); @@ -108,6 +110,16 @@ namespace Wabbajack.View_Models } } + private string _downloadStatusText; + public string DownloadStatusText + { + get => _downloadStatusText; + private set + { + RaiseAndSetIfChanged(ref _downloadStatusText, value); + } + } + public DownloadStatus Status { diff --git a/Wabbajack/Views/ModeSelectionView.xaml b/Wabbajack/Views/ModeSelectionView.xaml index 41829ae1..a7617625 100644 --- a/Wabbajack/Views/ModeSelectionView.xaml +++ b/Wabbajack/Views/ModeSelectionView.xaml @@ -43,7 +43,7 @@ - + @@ -74,15 +74,21 @@ TextAlignment="Right" /> - + -