Fully working focus jump behavior
MODIFY
WalletWasabi.Fluent/Models/RecoveryWord.cs
WalletWasabi.Fluent/Models/RecoveryWord.cs
@@ -65,5 +65,10 @@ namespace WalletWasabi.Fluent.Models
errors.Add(ErrorSeverity.Error, $"The input does not match to to the recovery word {Index}.");
}
+
+ public override string ToString()
+ {
+ return $"{Index}. {Word}";
+ }
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/Dialogs/CreateWallet/ConfirmRecoveryWordsViewModel.cs
WalletWasabi.Fluent/ViewModels/Dialogs/CreateWallet/ConfirmRecoveryWordsViewModel.cs
@@ -14,6 +14,8 @@ namespace WalletWasabi.Fluent.ViewModels.Dialogs.CreateWallet
{
public class ConfirmRecoveryWordsViewModel : ViewModelBase, IRoutableViewModel
{
+ private bool _isConfirmationFinished;
+
public ConfirmRecoveryWordsViewModel(IScreen screen, List<RecoveryWord> mnemonicWords)
{
HostScreen = screen;
@@ -26,6 +28,11 @@ namespace WalletWasabi.Fluent.ViewModels.Dialogs.CreateWallet
SetConfirmationWords(mnemonicWords);
}
+ public bool IsConfirmationFinished
+ {
+ get => _isConfirmationFinished;
+ set => this.RaiseAndSetIfChanged(ref _isConfirmationFinished, value);
+ }
public string UrlPathSegment { get; }
public IScreen HostScreen { get; }
public ObservableCollection<RecoveryWord> ConfirmationWords { get; }
@@ -53,6 +60,12 @@ namespace WalletWasabi.Fluent.ViewModels.Dialogs.CreateWallet
{
if (e.PropertyName == nameof(RecoveryWord.IsConfirmed))
{
+ // Finally. TODO: Refactor
+ foreach (var item in ConfirmationWords)
+ {
+ item.IsFocused = false;
+ }
+
var nextToFocus = ConfirmationWords.FirstOrDefault(x => x.IsConfirmed == false);
if (nextToFocus is { })
@@ -61,7 +74,7 @@ namespace WalletWasabi.Fluent.ViewModels.Dialogs.CreateWallet
}
else
{
- // Every item is confirmed
+ IsConfirmationFinished = true;
}
}
}

MODIFY
WalletWasabi.Fluent/Views/Dialogs/CreateWallet/ConfirmRecoveryWordsView.axaml
WalletWasabi.Fluent/Views/Dialogs/CreateWallet/ConfirmRecoveryWordsView.axaml
</StackPanel>
<Button Content="Cancel" Command="{Binding CancelCommand}" Classes="invisible" HorizontalAlignment="Left" VerticalAlignment="Bottom"/>
- <Button Content="Finish" Command="{Binding FinishCommand}" Classes="action" HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
+ <Button Content="Finish" Command="{Binding FinishCommand}" Classes="action" HorizontalAlignment="Right" VerticalAlignment="Bottom">
+ <i:Interaction.Behaviors>
+ <behaviors:FocusBehavior IsFocused="{Binding IsConfirmationFinished}"/>
+ </i:Interaction.Behaviors>
+ </Button>
</Panel>
</UserControl>

Fully working focus jump behavior