Implement compile complete view, hook up buttons and error alerts

This commit is contained in:
Timothy Baldridge 2022-07-12 22:51:12 -06:00
parent 653c83d7dd
commit 28e7e1f01a
2 changed files with 29 additions and 3 deletions

View File

@ -75,7 +75,8 @@
<TextBlock Grid.Row="1" <TextBlock Grid.Row="1"
x:Name="ActionText" x:Name="ActionText"
Margin="0,10,0,0" Margin="0,10,0,0"
HorizontalAlignment="Center" /> HorizontalAlignment="Center"
Text="Output Folder"/>
</Grid> </Grid>
<Grid Grid.Row="1" Grid.Column="2" <Grid Grid.Row="1" Grid.Column="2"
VerticalAlignment="Center" VerticalAlignment="Center"

View File

@ -1,4 +1,5 @@
using System.Diagnostics.Eventing.Reader; using System;
using System.Diagnostics.Eventing.Reader;
using System.Linq; using System.Linq;
using System.Reactive.Disposables; using System.Reactive.Disposables;
using System.Reactive.Linq; using System.Reactive.Linq;
@ -27,6 +28,30 @@ namespace Wabbajack
this.WhenActivated(disposables => this.WhenActivated(disposables =>
{ {
ViewModel.WhenAny(vm => vm.State)
.Select(x => x == CompilerState.Errored)
.BindToStrict(this, x => x.CompilationComplete.AttentionBorder.Failure)
.DisposeWith(disposables);
ViewModel.WhenAny(vm => vm.State)
.Select(x => x == CompilerState.Errored)
.Select(failed => $"Installation {(failed ? "Failed" : "Complete")}")
.BindToStrict(this, x => x.CompilationComplete.TitleText.Text)
.DisposeWith(disposables);
CompilationComplete.GoToModlistButton.Command = ReactiveCommand.Create(() =>
{
UIUtils.OpenFolder(ViewModel.OutputLocation.TargetPath.Parent);
}).DisposeWith(disposables);
ViewModel.WhenAnyValue(vm => vm.BackCommand)
.BindToStrict(this, view => view.CompilationComplete.BackButton.Command)
.DisposeWith(disposables);
CompilationComplete.CloseWhenCompletedButton.Command = ReactiveCommand.Create(() =>
{
Environment.Exit(0);
}).DisposeWith(disposables);
ViewModel.WhenAnyValue(vm => vm.ExecuteCommand) ViewModel.WhenAnyValue(vm => vm.ExecuteCommand)