Use Binding to Observable
MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/WelcomePageViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/WelcomePageViewModel.cs
@@ -22,10 +22,8 @@ public partial class WelcomePageViewModel : DialogViewModelBase<Unit>
SelectedIndex = 0;
NextCommand = ReactiveCommand.Create(OnNext);
- var canGoBackChanged = this.WhenAnyValue(x => x.SelectedIndex, i => i > 0);
- BackCommand = ReactiveCommand.Create(() => SelectedIndex--, canGoBackChanged);
- canGoBackChanged
- .Subscribe(canGoBack => EnableBack = canGoBack);
+ CanGoBack = this.WhenAnyValue(x => x.SelectedIndex, i => i > 0);
+ BackCommand = ReactiveCommand.Create(() => SelectedIndex--, CanGoBack);
this.WhenAnyValue(x => x.SelectedIndex)
.Subscribe(x =>
@@ -40,6 +38,8 @@ public partial class WelcomePageViewModel : DialogViewModelBase<Unit>
.Subscribe(x => EnableNextKey = false);
}
+ public IObservable<bool> CanGoBack { get; }
+
private void OnNext()
{
if (SelectedIndex < NumberOfPages - 1)

MODIFY
WalletWasabi.Fluent/Views/AddWallet/WelcomePageView.axaml
WalletWasabi.Fluent/Views/AddWallet/WelcomePageView.axaml
<behaviors:FocusOnAttachedBehavior />
</i:Interaction.Behaviors>
<controls:ContentArea EnableCancel="False"
- EnableBack="{Binding EnableBack}"
+ EnableBack="{Binding CanGoBack^}"
EnableNext="True"
ClipToBounds="False"
NextContent="{Binding NextLabel}"

Use Binding to Observable