Fix kegal docs navigation
MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/TermsAndConditionsViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/TermsAndConditionsViewModel.cs
@@ -24,7 +24,7 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
{
private bool _isAgreed;
- public TermsAndConditionsViewModel(NavigationStateViewModel navigationState, LegalDocuments legalDocuments) : base(navigationState, NavigationTarget.DialogScreen)
+ public TermsAndConditionsViewModel(NavigationStateViewModel navigationState, LegalDocuments legalDocuments, RoutableViewModel next) : base(navigationState, NavigationTarget.DialogScreen)
{
ViewTermsCommand = ReactiveCommand.CreateFromTask(
async () =>
@@ -40,8 +40,18 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
});
NextCommand = ReactiveCommand.Create(
- () => Close(true),
+ () =>
+ {
+ Close(true);
+ NavigateTo(next, NavigationTarget.DialogScreen);
+ },
this.WhenAnyValue(x => x.IsAgreed));
+
+ CancelCommand = ReactiveCommand.Create(() =>
+ {
+ Close();
+ GoBack();
+ });
}
public bool IsAgreed

MODIFY
WalletWasabi.Fluent/ViewModels/AddWalletPageViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWalletPageViewModel.cs
@@ -28,7 +28,11 @@ namespace WalletWasabi.Fluent.ViewModels
Title = "Add Wallet";
OpenCommand = ReactiveCommand.CreateFromTask(
- async () => await ShowTermsAndConditionsAsync(legalDocuments));
+ async () =>
+ {
+ var termsAndConditions = new TermsAndConditionsViewModel(navigationState, legalDocuments, this);
+ termsAndConditions.NavigateToSelf();
+ });
this.WhenAnyValue(x => x.WalletName)
.Select(x => !string.IsNullOrWhiteSpace(x))
@@ -76,22 +80,6 @@ namespace WalletWasabi.Fluent.ViewModels
this.ValidateProperty(x => x.WalletName, errors => ValidateWalletName(errors, walletManager, WalletName));
}
- private async Task ShowTermsAndConditionsAsync(LegalDocuments legalDocuments)
- {
- var termsAndConditions = new TermsAndConditionsViewModel(NavigationState, legalDocuments);
-
- termsAndConditions.NavigateToSelf();
-
- if (await termsAndConditions.GetDialogResultAsync())
- {
- NavigateToSelf();
- }
- else
- {
- GoBack();
- }
- }
-
private void ValidateWalletName(IValidationErrors errors, WalletManager walletManager, string walletName)
{
string walletFilePath = Path.Combine(walletManager.WalletDirectories.WalletsDir, $"{walletName}.json");

MODIFY
WalletWasabi.Fluent/Views/AddWallet/TermsAndConditionsView.axaml
WalletWasabi.Fluent/Views/AddWallet/TermsAndConditionsView.axaml
<KeyBinding Gesture="Enter" Command="{Binding NextCommand}" />
</UserControl.KeyBindings>
<c:ContentArea Title="Welcome to Wasabi Wallet"
- EnableCancel="False"
+ EnableCancel="True"
EnableNext="True" NextContent="Continue" FocusNext="True">
<DockPanel>
<CheckBox IsChecked="{Binding IsAgreed}" DockPanel.Dock="Bottom" Name="CheckBox_Agree">

Fix kegal docs navigation