move PSBT workflow toggle button into Wallet settings
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Advanced/WalletInfoViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Advanced/WalletInfoViewModel.cs
@@ -13,14 +13,12 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Advanced
[AutoNotify] private bool _showSensitiveData;
[AutoNotify] private string _showButtonText = "Show sensitive data";
[AutoNotify] private string _lockIconString = "eye_show_regular";
- [AutoNotify] private bool _preferPsbtWorkflow;
public WalletInfoViewModel(WalletViewModelBase walletViewModelBase)
{
var wallet = walletViewModelBase.Wallet;
var network = wallet.Network;
IsHardwareWallet = wallet.KeyManager.IsHardwareWallet;
- _preferPsbtWorkflow = wallet.KeyManager.PreferPsbtWorkflow;
SetupCancel(enableCancel: true, enableCancelOnEscape: true, enableCancelOnPressed: true);
@@ -50,13 +48,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Advanced
AccountKeyPath = $"m/{wallet.KeyManager.AccountKeyPath}";
MasterKeyFingerprint = wallet.KeyManager.MasterFingerprint.ToString();
- this.WhenAnyValue(x => x.PreferPsbtWorkflow)
- .Subscribe(value =>
- {
- wallet.KeyManager.PreferPsbtWorkflow = value;
- wallet.KeyManager.ToFile();
- walletViewModelBase.RaisePropertyChanged(nameof(walletViewModelBase.PreferPsbtWorkflow));
- });
+
}
public string ExtendedAccountPublicKey { get; }

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/WalletSettingsViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/WalletSettingsViewModel.cs
+using System;
+using ReactiveUI;
using WalletWasabi.Fluent.ViewModels.Navigation;
namespace WalletWasabi.Fluent.ViewModels.Wallets
@@ -5,11 +7,27 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
[NavigationMetaData(Title="Wallet Settings")]
public partial class WalletSettingsViewModel : RoutableViewModel
{
- public WalletSettingsViewModel(WalletViewModel walletViewModel)
+ [AutoNotify] private bool _preferPsbtWorkflow;
+
+ public WalletSettingsViewModel(WalletViewModelBase walletViewModelBase)
{
+ var wallet = walletViewModelBase.Wallet;
+ _preferPsbtWorkflow = wallet.KeyManager.PreferPsbtWorkflow;
+ IsHardwareWallet = wallet.KeyManager.IsHardwareWallet;
+
SetupCancel(enableCancel: false, enableCancelOnEscape: true, enableCancelOnPressed: true);
NextCommand = CancelCommand;
+
+ this.WhenAnyValue(x => x.PreferPsbtWorkflow)
+ .Subscribe(value =>
+ {
+ wallet.KeyManager.PreferPsbtWorkflow = value;
+ wallet.KeyManager.ToFile();
+ walletViewModelBase.RaisePropertyChanged(nameof(walletViewModelBase.PreferPsbtWorkflow));
+ });
}
+
+ public bool IsHardwareWallet { get; }
}
}

MODIFY
WalletWasabi.Fluent/Views/Wallets/Advanced/WalletInfoView.axaml
WalletWasabi.Fluent/Views/Wallets/Advanced/WalletInfoView.axaml
x:DataType="advanced:WalletInfoViewModel"
x:CompileBindings="True"
x:Class="WalletWasabi.Fluent.Views.Wallets.Advanced.WalletInfoView">
- <c:ContentArea EnableNext="True" NextContent="Done"
+ <c:ContentArea Title="{Binding Title}"
+ EnableNext="True" NextContent="Done"
EnableCancel="{Binding EnableCancel}"
EnableBack="{Binding EnableBack}">
- <c:ContentArea.Title>
- <DockPanel>
- <StackPanel Orientation="Horizontal" Spacing="10" DockPanel.Dock="Right" IsVisible="{Binding IsHardwareWallet}">
- <TextBlock VerticalAlignment="Center" Text="PSBT workflow" FontSize="14"/>
- <ToggleSwitch IsChecked="{Binding PreferPsbtWorkflow}" OnContent="{x:Null}" OffContent="{x:Null}" />
- </StackPanel>
- <TextBlock TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding Title}" />
- </DockPanel>
- </c:ContentArea.Title>
<c:ContentArea.CancelContent>
<StackPanel Spacing="10" Orientation="Horizontal">
<PathIcon Data="{Binding LockIconString, Converter={x:Static conv:NavBarIconConverter.Instance}}" />

MODIFY
WalletWasabi.Fluent/Views/Wallets/WalletSettingsView.axaml
WalletWasabi.Fluent/Views/Wallets/WalletSettingsView.axaml
Caption="These settings only apply to this wallet."
EnableNext="True" NextContent="Done"
EnableCancel="{Binding EnableCancel}"
- EnableBack="{Binding EnableBack}" />
+ EnableBack="{Binding EnableBack}">
+ <StackPanel Spacing="20">
+ <StackPanel.Styles>
+ <Style Selector="DockPanel > TextBlock">
+ <Setter Property="Margin" Value="0 8 20 0" />
+ <Setter Property="VerticalAlignment" Value="Top" />
+ <Setter Property="(DockPanel.Dock)" Value="Left" />
+ </Style>
+ <Style Selector="DockPanel > ToggleSwitch">
+ <Setter Property="Margin" Value="0 0 -12 0" />
+ <Setter Property="HorizontalAlignment" Value="Right" />
+ <Setter Property="OnContent" Value="{x:Null}" />
+ <Setter Property="OffContent" Value="{x:Null}" />
+ </Style>
+ </StackPanel.Styles>
+
+ <DockPanel IsVisible="{Binding IsHardwareWallet}">
+ <TextBlock Text="PSBT workflow" />
+ <ToggleSwitch IsChecked="{Binding PreferPsbtWorkflow}" />
+ </DockPanel>
+ </StackPanel>
+ </c:ContentArea>
</UserControl>

move PSBT workflow toggle button into Wallet settings