OpenReadmeCommand now only executable if UIReady

The function it calls shortcircuits if UIReady is false, so the command shouldn't be runnable if that's the state
This commit is contained in:
Justin Swanson 2019-10-13 03:11:31 -05:00
parent d60d6a65a6
commit ead583ac1d

View File

@ -106,8 +106,11 @@ namespace Wabbajack
this.OpenModListPropertiesCommand = ReactiveCommand.Create(OpenModListProperties);
this.OpenReadmeCommand = ReactiveCommand.Create(
execute: this.OpenReadmeWindow,
canExecute: this.WhenAny(x => x.ModList)
.Select(modList => !string.IsNullOrEmpty(modList?.Readme))
canExecute: Observable.CombineLatest(
this.WhenAny(x => x.ModList)
.Select(modList => !string.IsNullOrEmpty(modList?.Readme)),
this.WhenAny(x => x.UIReady),
resultSelector: (modListExists, uiReady) => modListExists && uiReady)
.ObserveOnGuiThread());
this.BeginCommand = ReactiveCommand.Create(
execute: this.ExecuteBegin,