Correctly hide MusicBox controls when wallet is private
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/CoinJoinStateViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/CoinJoinStateViewModel.cs
@@ -287,7 +287,7 @@ public partial class CoinJoinStateViewModel : ViewModelBase
private void ProcessStatusChange(StatusChangedEventArgs e)
{
- AreAllCoinsPrivate = false;
+ AreAllCoinsPrivate = WalletVm.Wallet.IsWalletPrivate();
switch (e)
{
@@ -304,22 +304,13 @@ public partial class CoinJoinStateViewModel : ViewModelBase
break;
case StartErrorEventArgs start:
- switch (start.Error)
+ CurrentStatus = start.Error switch
{
- case CoinjoinError.NoCoinsToMix:
- CurrentStatus = new() { Message = "Waiting for confirmed funds" };
- break;
- case CoinjoinError.UserInSendWorkflow:
- CurrentStatus = new() { Message = "Waiting for closed send dialog" };
- break;
- case CoinjoinError.AllCoinsPrivate:
- AreAllCoinsPrivate = true;
- CurrentStatus = new() { Message = "Hurray!! Your wallet is private" };
- break;
- default:
- CurrentStatus = new() { Message = "Waiting for valid conditions" };
- break;
- }
+ CoinjoinError.NoCoinsToMix => new() { Message = "Waiting for confirmed funds" },
+ CoinjoinError.UserInSendWorkflow => new() { Message = "Waiting for closed send dialog" },
+ CoinjoinError.AllCoinsPrivate => new() { Message = "Hurray!! Your wallet is private" },
+ _ => new() { Message = "Waiting for valid conditions" }
+ };
break;

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModel.cs
@@ -35,6 +35,7 @@ public partial class WalletViewModel : WalletViewModelBase
[AutoNotify] private int _layoutIndex;
[AutoNotify] private double _widthSource;
[AutoNotify] private double _heightSource;
+ [AutoNotify] private bool _isPointerOver;
[AutoNotify(SetterModifier = AccessModifier.Private)] private bool _isSmallLayout;
[AutoNotify(SetterModifier = AccessModifier.Private)] private bool _isNormalLayout;
[AutoNotify(SetterModifier = AccessModifier.Private)] private bool _isWideLayout;
@@ -127,13 +128,13 @@ public partial class WalletViewModel : WalletViewModelBase
.Subscribe(_ => IsSendButtonVisible = !IsWalletBalanceZero && (!wallet.KeyManager.IsWatchOnly || wallet.KeyManager.IsHardwareWallet));
IsMusicBoxVisible =
- this.WhenAnyValue(x => x.IsSelected, x => x.IsWalletBalanceZero, x => x.CoinJoinStateViewModel.AreAllCoinsPrivate)
+ this.WhenAnyValue(x => x.IsSelected, x => x.IsWalletBalanceZero, x => x.CoinJoinStateViewModel.AreAllCoinsPrivate, x => x.IsPointerOver)
.Throttle(TimeSpan.FromMilliseconds(200), RxApp.MainThreadScheduler)
.Select(
tuple =>
{
- var (isSelected, isWalletBalanceZero, areAllCoinsPrivate) = tuple;
- return isSelected && !isWalletBalanceZero && !wallet.KeyManager.IsWatchOnly && !areAllCoinsPrivate;
+ var (isSelected, isWalletBalanceZero, areAllCoinsPrivate, pointerOver) = tuple;
+ return isSelected && !isWalletBalanceZero && !wallet.KeyManager.IsWatchOnly && !areAllCoinsPrivate || pointerOver;
});
SendCommand = ReactiveCommand.Create(() => Navigate(NavigationTarget.DialogScreen).To(new SendViewModel(wallet, balanceChanged, History.UnfilteredTransactions)));

MODIFY
WalletWasabi.Fluent/Views/Wallets/MusicControlsView.axaml
WalletWasabi.Fluent/Views/Wallets/MusicControlsView.axaml
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:wallets="clr-namespace:WalletWasabi.Fluent.ViewModels.Wallets"
- xmlns:controls="clr-namespace:WalletWasabi.Fluent.Controls"
+ Background="Transparent"
+ IsPointerOver="{Binding IsPointerOver, Mode=OneWayToSource}"
x:DataType="wallets:WalletViewModel"
x:CompileBindings="True"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="64"

Correctly hide MusicBox controls when wallet is private