create wallet command
MODIFY
WalletWasabi.Fluent/ViewModels/AddWalletPageViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWalletPageViewModel.cs
using System.Reactive.Linq;
using ReactiveUI;
using System;
+using System.Windows.Input;
+using Splat;
+using WalletWasabi.Gui;
+using WalletWasabi.Fluent.AddWallet.Common;
namespace WalletWasabi.Fluent.ViewModels
{
@@ -16,6 +20,13 @@ namespace WalletWasabi.Fluent.ViewModels
this.WhenAnyValue(x => x.WalletName)
.Select(x => !string.IsNullOrWhiteSpace(x))
.Subscribe(x => OptionsEnabled = x);
+
+ CreateWalletCommand = ReactiveCommand.Create(() =>
+ {
+ var global = Locator.Current.GetService<Global>();
+
+ screen.Router.Navigate.Execute(new EnterPasswordViewModel(screen, global, WalletName));
+ });
}
public override string IconName => "add_circle_regular";
@@ -31,5 +42,8 @@ namespace WalletWasabi.Fluent.ViewModels
get => _optionsEnabled;
set => this.RaiseAndSetIfChanged(ref _optionsEnabled, value);
}
+
+ public ICommand CreateWalletCommand { get; }
+
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/SettingsPageViewModel.cs
WalletWasabi.Fluent/ViewModels/SettingsPageViewModel.cs
@@ -8,12 +8,6 @@ using WalletWasabi.Gui.Validation;
using WalletWasabi.Models;
using Avalonia;
using Avalonia.Markup.Xaml.Styling;
-using WalletWasabi.Blockchain.Keys;
-using WalletWasabi.Gui;
-using Splat;
-using WalletWasabi.Fluent.AddWallet.CreateWallet;
-using WalletWasabi.Fluent.AddWallet.Common;
-using System.IO;
namespace WalletWasabi.Fluent.ViewModels
{
@@ -26,12 +20,6 @@ namespace WalletWasabi.Fluent.ViewModels
Title = "Settings";
NextCommand = ReactiveCommand.Create(() => screen.Router.Navigate.Execute(new AddWalletPageViewModel(screen)));
- CreateWalletCommand = ReactiveCommand.Create(() =>
- {
- var global = Locator.Current.GetService<Global>();
-
- screen.Router.Navigate.Execute(new EnterPasswordViewModel(screen, global, Path.GetRandomFileName()));
- });
OpenDialogCommand = ReactiveCommand.CreateFromTask(async () => await ConfirmSetting.Handle("Please confirm the setting:").ToTask());
@@ -77,7 +65,6 @@ namespace WalletWasabi.Fluent.ViewModels
public ICommand OpenDialogCommand { get; }
public Interaction<string, bool> ConfirmSetting { get; }
public ICommand ChangeThemeCommand { get; }
- public ICommand CreateWalletCommand { get; }
public override string IconName => "settings_regular";
}

MODIFY
WalletWasabi.Fluent/Views/AddWalletPageView.axaml
WalletWasabi.Fluent/Views/AddWalletPageView.axaml
<Setter Property="IsVisible" Value="{Binding OptionsEnabled}" />
</Style>
</StackPanel.Styles>
- <Button Classes="option">
+ <Button Classes="option" Command="{Binding CreateWalletCommand}">
<StackPanel Orientation="Horizontal">
<PathIcon DockPanel.Dock="Left" Margin="20" Data="{StaticResource add_regular}" Width="16"
VerticalAlignment="Center" />

create wallet command