add skip button
MODIFY
WalletWasabi.Fluent/Controls/ContentArea.axaml
WalletWasabi.Fluent/Controls/ContentArea.axaml
<behaviors:FocusOnAttachedBehavior IsEnabled="{Binding FocusCancel, RelativeSource={RelativeSource TemplatedParent}}" />
</i:Interaction.Behaviors>
</Button>
- <Button Name="PART_NextButton" Classes="action" IsVisible="{TemplateBinding EnableNext}" Content="{TemplateBinding NextContent}" Margin="10,10,0,10" HorizontalAlignment="Right" Command="{Binding NextCommand}" IsDefault="True">
+ <StackPanel Orientation="Horizontal" Spacing="30" Margin="0 10" HorizontalAlignment="Right">
+ <Button IsVisible="{TemplateBinding EnableSkip}" Content="{TemplateBinding SkipContent}" Command="{Binding SkipCommand}" Classes="activeHyperLink skip" VerticalAlignment="Center" />
+ <Button Name="PART_NextButton" Classes="action" IsVisible="{TemplateBinding EnableNext}" Content="{TemplateBinding NextContent}" Command="{Binding NextCommand}" IsDefault="True">
<i:Interaction.Behaviors>
<behaviors:FocusOnAttachedBehavior IsEnabled="{Binding FocusNext, RelativeSource={RelativeSource TemplatedParent}}" />
</i:Interaction.Behaviors>
</Button>
+ </StackPanel>
</Panel>
<ScrollViewer HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
<Setter Property="Height" Value="100"/>
</Style>
+ <Style Selector="Button.skip:pointerover /template/ ContentPresenter">
+ <Setter Property="TextBlock.Foreground" Value="{DynamicResource SystemAccentColor}" />
+ </Style>
+
</Styles>

MODIFY
WalletWasabi.Fluent/Controls/ContentArea.axaml.cs
WalletWasabi.Fluent/Controls/ContentArea.axaml.cs
@@ -21,6 +21,9 @@ namespace WalletWasabi.Fluent.Controls
public static readonly StyledProperty<bool> EnableNextProperty =
AvaloniaProperty.Register<ContentArea, bool>(nameof(EnableNext));
+ public static readonly StyledProperty<bool> EnableSkipProperty =
+ AvaloniaProperty.Register<ContentArea, bool>(nameof(EnableSkip));
+
public static readonly StyledProperty<bool> FocusNextProperty =
AvaloniaProperty.Register<ContentArea, bool>(nameof(FocusNext));
@@ -33,6 +36,9 @@ namespace WalletWasabi.Fluent.Controls
public static readonly StyledProperty<object> NextContentProperty =
AvaloniaProperty.Register<ContentArea, object>(nameof(NextContent), "Next");
+ public static readonly StyledProperty<object> SkipContentProperty =
+ AvaloniaProperty.Register<ContentArea, object>(nameof(NextContent), "Skip");
+
public static readonly StyledProperty<bool> IsBusyProperty =
AvaloniaProperty.Register<ContentArea, bool>(nameof(IsBusy));
@@ -69,6 +75,12 @@ namespace WalletWasabi.Fluent.Controls
set => SetValue(EnableNextProperty, value);
}
+ public bool EnableSkip
+ {
+ get => GetValue(EnableSkipProperty);
+ set => SetValue(EnableSkipProperty, value);
+ }
+
public bool FocusNext
{
get => GetValue(FocusNextProperty);
@@ -93,6 +105,12 @@ namespace WalletWasabi.Fluent.Controls
set => SetValue(NextContentProperty, value);
}
+ public object SkipContent
+ {
+ get => GetValue(SkipContentProperty);
+ set => SetValue(SkipContentProperty, value);
+ }
+
public bool IsBusy
{
get => GetValue(IsBusyProperty);

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/Create/ConfirmRecoveryWordsViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/Create/ConfirmRecoveryWordsViewModel.cs
@@ -13,22 +13,23 @@ using WalletWasabi.Wallets;
namespace WalletWasabi.Fluent.ViewModels.AddWallet.Create
{
- public class ConfirmRecoveryWordsViewModel : RoutableViewModel
+ public partial class ConfirmRecoveryWordsViewModel : RoutableViewModel
{
+ [AutoNotify] private bool _isSkipEnable;
private readonly ReadOnlyObservableCollection<RecoveryWordViewModel> _confirmationWords;
public ConfirmRecoveryWordsViewModel(List<RecoveryWordViewModel> mnemonicWords, KeyManager keyManager, WalletManager walletManager)
{
Title = "Confirm recovery words";
-
var confirmationWordsSourceList = new SourceList<RecoveryWordViewModel>();
+ _isSkipEnable = walletManager.Network != Network.Main;
var nextCommandCanExecute =
confirmationWordsSourceList
.Connect()
.ObserveOn(RxApp.MainThreadScheduler)
.WhenValueChanged(x => x.IsConfirmed)
- .Select(_ => confirmationWordsSourceList.Items.All(x => x.IsConfirmed) || walletManager.Network != Network.Main);
+ .Select(_ => confirmationWordsSourceList.Items.All(x => x.IsConfirmed));
NextCommand = ReactiveCommand.Create(
() =>
@@ -37,6 +38,11 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet.Create
},
nextCommandCanExecute);
+ if (_isSkipEnable)
+ {
+ SkipCommand = ReactiveCommand.Create(() => NextCommand.Execute(null));
+ }
+
CancelCommand = ReactiveCommand.Create(() => Navigate().Clear());
confirmationWordsSourceList

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/Create/RecoveryWordViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/Create/RecoveryWordViewModel.cs
-using ReactiveUI;
using WalletWasabi.Gui.Validation;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Models;

MODIFY
WalletWasabi.Fluent/ViewModels/Navigation/RoutableViewModel.cs
WalletWasabi.Fluent/ViewModels/Navigation/RoutableViewModel.cs
@@ -30,6 +30,8 @@ namespace WalletWasabi.Fluent.ViewModels.Navigation
public ICommand? NextCommand { get; protected set; }
+ public ICommand? SkipCommand { get; protected set; }
+
public ICommand BackCommand { get; protected set; }
public ICommand CancelCommand { get; protected set; }

MODIFY
WalletWasabi.Fluent/Views/AddWallet/Create/ConfirmRecoveryWordsView.axaml
WalletWasabi.Fluent/Views/AddWallet/Create/ConfirmRecoveryWordsView.axaml
<c:ContentArea Title="{Binding Title}" Caption="Type the required recovery words"
EnableBack="True"
EnableCancel="False"
- EnableNext="True" NextContent="Continue">
+ EnableNext="True" NextContent="Continue"
+ EnableSkip="{Binding IsSkipEnable}">
<ScrollViewer>
<ItemsControl HorizontalAlignment="Center" VerticalAlignment="Center" Items="{Binding ConfirmationWords}">
<i:Interaction.Behaviors>

add skip button