Welcome Page Improvements
MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/WelcomePageViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/WelcomePageViewModel.cs
using System.Reactive;
-using System.Reactive.Linq;
-using System.Windows.Input;
using Avalonia.Media.Imaging;
using ReactiveUI;
using WalletWasabi.Fluent.Helpers;
@@ -12,30 +10,22 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet;
public partial class WelcomePageViewModel : DialogViewModelBase<Unit>
{
private const int NumberOfPages = 5;
-
+ private readonly AddWalletPageViewModel _addWalletPage;
[AutoNotify] private int _selectedIndex;
+ [AutoNotify] private string? _nextLabel;
public WelcomePageViewModel(AddWalletPageViewModel addWalletPage)
{
+ _addWalletPage = addWalletPage;
+
SetupCancel(enableCancel: false, enableCancelOnEscape: false, enableCancelOnPressed: false);
EnableBack = false;
- GetStartedCommand = ReactiveCommand.Create(() =>
- {
- if (!Services.WalletManager.HasWallet())
- {
- Navigate().To(addWalletPage);
- }
- else
- {
- Close();
- }
- });
-
SelectedIndex = 0;
+ NextCommand = ReactiveCommand.Create(OnNext);
- NextCommand = ReactiveCommand.Create(() => SelectedIndex++, this.WhenAnyValue(x => x.SelectedIndex).Select(c => c < NumberOfPages - 1));
- PrevCommand = ReactiveCommand.Create(() => SelectedIndex--, this.WhenAnyValue(x => x.SelectedIndex).Select(c => c > 0));
+ this.WhenAnyValue(x => x.SelectedIndex)
+ .Subscribe(x => NextLabel = x < NumberOfPages - 1 ? "Continue" : "Get Started");
}
public Bitmap WelcomeImage { get; } = AssetHelpers.GetBitmapAsset($"avares://WalletWasabi.Fluent/Assets/WelcomeScreen/{ThemeHelper.CurrentTheme}/welcome.png");
@@ -46,7 +36,19 @@ public partial class WelcomePageViewModel : DialogViewModelBase<Unit>
public Bitmap AnonymousImage { get; } = AssetHelpers.GetBitmapAsset($"avares://WalletWasabi.Fluent/Assets/WelcomeScreen/{ThemeHelper.CurrentTheme}/anonymous.png");
- public ICommand GetStartedCommand { get; }
-
- public ICommand PrevCommand { get; }
+ private void OnNext()
+ {
+ if (SelectedIndex < NumberOfPages - 1)
+ {
+ SelectedIndex++;
+ }
+ else if (!Services.WalletManager.HasWallet())
+ {
+ Navigate().To(_addWalletPage);
+ }
+ else
+ {
+ Close();
+ }
+ }
}

MODIFY
WalletWasabi.Fluent/Views/AddWallet/WelcomePageView.axaml
WalletWasabi.Fluent/Views/AddWallet/WelcomePageView.axaml
x:CompileBindings="True">
<UserControl.KeyBindings>
<KeyBinding Gesture="Right" Command="{Binding NextCommand}" />
- <KeyBinding Gesture="Left" Command="{Binding PrevCommand}" />
</UserControl.KeyBindings>
<i:Interaction.Behaviors>
<behaviors:FocusOnAttachedBehavior />
</i:Interaction.Behaviors>
- <controls:ContentArea EnableCancel="{Binding EnableCancel}"
- EnableBack="{Binding EnableBack}"
- EnableNext="False"
+ <controls:ContentArea EnableCancel="False"
+ EnableBack="False"
+ EnableNext="True"
+ NextContent="{Binding NextLabel}"
ScrollViewer.VerticalScrollBarVisibility="Disabled">
<DockPanel LastChildFill="True" x:DataType="addWallet:WelcomePageViewModel">
<Setter Property="Width" Value="5" />
</Style>
</StackPanel.Styles>
- <Button Command="{Binding PrevCommand}">
- <PathIcon Data="{StaticResource chevron_left}" />
- </Button>
- <Button Command="{Binding NextCommand}">
- <PathIcon Data="{StaticResource chevron_right}" />
- </Button>
</StackPanel>
</Panel>
<TextBlock Classes="text" Text="If you don't control your private keys, then you are not the true owner of your funds. Wasabi is non-custodial: the developers cannot steal or freeze your funds." />
<TextBlock Text="Non-Custodial"
Classes="title" />
- <Viewbox Classes="icon">
- <PathIcon Data="{StaticResource shield_regular}" Foreground="{DynamicResource SliderTrackValueFill}" />
- </Viewbox>
</DockPanel>
<Viewbox Grid.Column="1" VerticalAlignment="Center">
<Image Source="{Binding TrustlessImage}" />
<TextBlock Classes="text" Text="Wasabi provides privacy by default, it protects your financial information through coinjoins, client-side block filtering, and communication over the Tor anonymity network. Neither the public nor the developers can breach your privacy." />
<TextBlock Text="Anonymous"
Classes="title" />
- <Viewbox Classes="icon">
- <PathIcon Data="{StaticResource incognito_regular}" Foreground="{DynamicResource SliderTrackValueFill}" />
- </Viewbox>
</DockPanel>
<Viewbox Grid.Column="1" VerticalAlignment="Center">
<Image Source="{Binding AnonymousImage}" />
<TextBlock Classes="text" Text="To ensure the code - running on your computer - can indeed protect you from the developers and the public, Wasabi is free, open-source and deterministically reproducible software." />
<TextBlock Text="Open-Source"
Classes="title" />
- <Viewbox Classes="icon">
- <PathIcon Data="{StaticResource heart_regular}" Foreground="{DynamicResource SliderTrackValueFill}" />
- </Viewbox>
</DockPanel>
<Viewbox Grid.Column="1" VerticalAlignment="Center">
<Image Source="{Binding OpensourceImage}" />
<!-- Get started -->
<DockPanel HorizontalAlignment="Center" VerticalAlignment="Center">
- <Button HorizontalAlignment="Center"
- Classes="action"
- Content="Get Started"
- Command="{Binding GetStartedCommand}"
- IsDefault="{Binding IsActive}"
- DockPanel.Dock="Bottom" />
<TextBlock TextAlignment="Center"
Text="The 1st Rule of Wasabi: Wasabi is for self defense and self defense only"
Opacity="0.6"

Welcome Page Improvements