Improved top title bar configuration text

This commit is contained in:
Justin Swanson 2019-12-27 15:50:27 -06:00
parent bebd898964
commit 6c4fbc8476
3 changed files with 28 additions and 3 deletions

View File

@ -60,6 +60,9 @@ namespace Wabbajack
[Reactive]
public ErrorResponse? Completed { get; set; }
private readonly ObservableAsPropertyHelper<string> _progressTitle;
public string ProgressTitle => _progressTitle.Value;
public CompilerVM(MainWindowVM mainWindowVM)
{
MWVM = mainWindowVM;
@ -247,6 +250,22 @@ namespace Wabbajack
Process.Start("explorer.exe", OutputLocation.TargetPath);
}
});
_progressTitle = Observable.CombineLatest(
this.WhenAny(x => x.Compiling),
this.WhenAny(x => x.StartedCompilation),
resultSelector: (compiling, started) =>
{
if (compiling)
{
return "Compiling";
}
else
{
return started ? "Compiled" : "Configuring";
}
})
.ToProperty(this, nameof(ProgressTitle));
}
}
}

View File

@ -281,8 +281,14 @@ namespace Wabbajack
this.WhenAny(x => x.StartedInstallation),
resultSelector: (installing, started) =>
{
if (!installing) return "Configuring";
return started ? "Installing" : "Installed";
if (installing)
{
return "Installing";
}
else
{
return started ? "Installed" : "Configuring";
}
})
.ToProperty(this, nameof(ProgressTitle));

View File

@ -77,7 +77,7 @@
Grid.ColumnSpan="5"
OverhangShadow="True"
ProgressPercent="{Binding PercentCompleted}"
StatePrefixTitle="Compiling" />
StatePrefixTitle="{Binding ProgressTitle}" />
<Button
x:Name="BackButton"
Grid.Row="0"