Welcome Page fixes
MODIFY
WalletWasabi.Fluent/Controls/ContentArea.axaml
WalletWasabi.Fluent/Controls/ContentArea.axaml
<ContentPresenter Name="PART_TitlePresenter" Content="{TemplateBinding Title}" />
</DockPanel>
<ContentPresenter Name="PART_CaptionPresenter" Content="{TemplateBinding Caption}" />
+ <Panel Height="6" IsVisible="{Binding !EnableBack}"/>
</StackPanel>
</Panel>

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/WelcomePageViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/WelcomePageViewModel.cs
using System.Reactive;
+using System.Reactive.Linq;
using Avalonia.Media.Imaging;
using ReactiveUI;
using WalletWasabi.Fluent.Helpers;
@@ -13,19 +14,33 @@ public partial class WelcomePageViewModel : DialogViewModelBase<Unit>
private readonly AddWalletPageViewModel _addWalletPage;
[AutoNotify] private int _selectedIndex;
[AutoNotify] private string? _nextLabel;
+ [AutoNotify] private bool _enableNextKey = true;
public WelcomePageViewModel(AddWalletPageViewModel addWalletPage)
{
_addWalletPage = addWalletPage;
SetupCancel(enableCancel: false, enableCancelOnEscape: false, enableCancelOnPressed: false);
- EnableBack = false;
SelectedIndex = 0;
NextCommand = ReactiveCommand.Create(OnNext);
-
+ BackCommand = ReactiveCommand.Create(OnBack, this.WhenAnyValue(x => x.SelectedIndex).Select(x => x > 0));
this.WhenAnyValue(x => x.SelectedIndex)
- .Subscribe(x => NextLabel = x < NumberOfPages - 1 ? "Continue" : "Get Started");
+ .Subscribe(x =>
+ {
+ NextLabel = x < NumberOfPages - 1 ? "Continue" : "Get Started";
+ EnableBack = x > 0;
+ EnableNextKey = x < NumberOfPages - 1;
+ });
+
+ this.WhenAnyValue(x => x.IsActive)
+ .Skip(1)
+ .Where(x => !x)
+ .Subscribe(x =>
+ {
+ EnableNextKey = false;
+ EnableBack = false;
+ });
}
public Bitmap WelcomeImage { get; } = AssetHelpers.GetBitmapAsset($"avares://WalletWasabi.Fluent/Assets/WelcomeScreen/{ThemeHelper.CurrentTheme}/welcome.png");
@@ -51,4 +66,12 @@ public partial class WelcomePageViewModel : DialogViewModelBase<Unit>
Close();
}
}
+
+ private void OnBack()
+ {
+ if (SelectedIndex > 0)
+ {
+ SelectedIndex--;
+ }
+ }
}

MODIFY
WalletWasabi.Fluent/Views/AddWallet/WelcomePageView.axaml
WalletWasabi.Fluent/Views/AddWallet/WelcomePageView.axaml
x:Class="WalletWasabi.Fluent.Views.AddWallet.WelcomePageView"
x:DataType="addWallet:WelcomePageViewModel"
x:CompileBindings="True">
- <UserControl.KeyBindings>
- <KeyBinding Gesture="Right" Command="{Binding NextCommand}" />
- </UserControl.KeyBindings>
<i:Interaction.Behaviors>
<behaviors:FocusOnAttachedBehavior />
</i:Interaction.Behaviors>
<controls:ContentArea EnableCancel="False"
- EnableBack="False"
+ EnableBack="{Binding EnableBack}"
EnableNext="True"
NextContent="{Binding NextLabel}"
ScrollViewer.VerticalScrollBarVisibility="Disabled">
<Carousel SelectedIndex="{Binding SelectedIndex}"
DockPanel.Dock="Top"
Margin="0 10">
+ <i:Interaction.Behaviors>
+ <behaviors:ExecuteCommandOnKeyDownBehavior Command="{Binding BackCommand}" IsEnabled="{Binding EnableBack}" Key="Left"/>
+ <behaviors:ExecuteCommandOnKeyDownBehavior Command="{Binding NextCommand}" IsEnabled="{Binding EnableNextKey}" Key="Right"/>
+ </i:Interaction.Behaviors>
<Carousel.Styles>
<Style Selector="TextBlock.text">
<Setter Property="DockPanel.Dock" Value="Bottom" />

Welcome Page fixes