use the wallet's `IsActive`
MODIFY
WalletWasabi.Fluent/ViewModels/MainViewModel.cs
WalletWasabi.Fluent/ViewModels/MainViewModel.cs
@@ -41,6 +41,7 @@ public partial class MainViewModel : ViewModelBase
[AutoNotify] private double _windowWidth;
[AutoNotify] private double _windowHeight;
[AutoNotify] private PixelPoint? _windowPosition;
+ [AutoNotify] private WalletViewModel? _currentWallet;
public MainViewModel()
{
@@ -77,8 +78,6 @@ public partial class MainViewModel : ViewModelBase
_privacyMode = new PrivacyModeViewModel();
_navBar = new NavBarViewModel(MainScreen);
- MusicControls = new MusicControlsViewModel();
-
NavigationManager.RegisterType(_navBar);
RegisterViewModels();
@@ -168,6 +167,11 @@ public partial class MainViewModel : ViewModelBase
}
});
+ this.WhenAnyValue(x => x.MainScreen.CurrentPage)
+ .WhereNotNull()
+ .OfType<WalletViewModel>()
+ .Subscribe(wallet => CurrentWallet = wallet);
+
IsOobeBackgroundVisible = Services.UiConfig.Oobe;
RxApp.MainThreadScheduler.Schedule(async () =>
@@ -192,8 +196,6 @@ public partial class MainViewModel : ViewModelBase
public TargettedNavigationStack MainScreen { get; }
- public MusicControlsViewModel MusicControls { get; }
-
public SearchBarViewModel SearchBar { get; }
public static MainViewModel Instance { get; } = new();

MODIFY
WalletWasabi.Fluent/Views/Shell/MainView.axaml
WalletWasabi.Fluent/Views/Shell/MainView.axaml
<Panel VerticalAlignment="Bottom"
Height="100">
<spectrum:SpectrumControl Opacity="0.6" IsActive="{Binding IsCoinJoinActive}"
- IsDockEffectVisible="{Binding MusicControls.IsActive}"
- Classes.fireEffect="{Binding MusicControls.CurrentWallet.CoinJoinStateViewModel.IsInCriticalPhase, FallbackValue=False}">
+ Classes.fireEffect="{Binding CurrentWallet.CoinJoinStateViewModel.IsInCriticalPhase, FallbackValue=False}">
+ <spectrum:SpectrumControl.IsDockEffectVisible>
+ <MultiBinding Converter="{x:Static BoolConverters.And}">
+ <Binding Path="CurrentWallet.IsActive" FallbackValue="False" />
+ <Binding Path="CurrentWallet.IsWalletBalanceZero" FallbackValue="False" Converter="{x:Static BoolConverters.Not}" />
+ <Binding Path="CurrentWallet.Wallet.KeyManager.IsWatchOnly" FallbackValue="False" Converter="{x:Static BoolConverters.Not}" />
+ </MultiBinding>
+ </spectrum:SpectrumControl.IsDockEffectVisible>
<spectrum:SpectrumControl.Styles>
<Style Selector="spectrum|SpectrumControl.fireEffect">
<Setter Property="Foreground" Value="{StaticResource OrangeCoinColor}" />
<Setter Property="Margin" Value="31 26 31 0" />
</Style>
</DockPanel.Styles>
- <wallets:MusicControlsView DockPanel.Dock="Bottom" DataContext="{Binding MusicControls}"
+ <wallets:MusicControlsView DockPanel.Dock="Bottom" DataContext="{Binding CurrentWallet}"
HorizontalAlignment="Center" Height="66" />
<ContentControl ClipToBounds="False" Content="{Binding MainScreen.CurrentPage}" />
</DockPanel>

MODIFY
WalletWasabi.Fluent/Views/Wallets/MusicControlsView.axaml
WalletWasabi.Fluent/Views/Wallets/MusicControlsView.axaml
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:wallets="clr-namespace:WalletWasabi.Fluent.ViewModels.Wallets"
xmlns:controls="clr-namespace:WalletWasabi.Fluent.Controls"
- x:DataType="wallets:MusicControlsViewModel"
+ x:DataType="wallets:WalletViewModel"
x:CompileBindings="True"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="64"
x:Class="WalletWasabi.Fluent.Views.Wallets.MusicControlsView">
</Style>
</UserControl.Styles>
<Border Name="PART_MainBorder" Margin="3 3 3 0"
- Classes.IsActive="{Binding IsActive, FallbackValue=false}"
TextBlock.FontFamily="{StaticResource MonospacedFont}"
CornerRadius="4 4 0 0">
+ <Classes.IsActive>
+ <MultiBinding Converter="{x:Static BoolConverters.And}">
+ <Binding Path="IsActive" FallbackValue="False" />
+ <Binding Path="IsWalletBalanceZero" FallbackValue="False" Converter="{x:Static BoolConverters.Not}" />
+ <Binding Path="Wallet.KeyManager.IsWatchOnly" FallbackValue="False" Converter="{x:Static BoolConverters.Not}" />
+ </MultiBinding>
+ </Classes.IsActive>
<Border ClipToBounds="True"
CornerRadius="4 4 0 0"
BorderBrush="{DynamicResource GlassEdgeColor}"
BorderThickness="1,1,1,0">
- <Panel DataContext="{Binding CurrentWallet.CoinJoinStateViewModel}">
+ <Panel DataContext="{Binding CoinJoinStateViewModel}">
<Panel Background="{DynamicResource TileRegionColor}" Opacity="0.35" />
<StackPanel Margin="10 5" Orientation="Horizontal" Spacing="20">
<Image Height="35" Width="35" VerticalAlignment="Center" HorizontalAlignment="Center" Source="{DynamicResource wasabi_logo_dynamic}" />

use the wallet's `IsActive`