Thanks to the hack is removed :)
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/PrivacyRing/PrivacyBarViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/PrivacyRing/PrivacyBarViewModel.cs
@@ -20,7 +20,6 @@ public partial class PrivacyBarViewModel : ViewModelBase
private IObservable<Unit> _coinsUpdated;
[AutoNotify] private double _width;
- [AutoNotify] private bool _isEmpty;
public PrivacyBarViewModel(WalletViewModel walletViewModel, IObservable<Unit> balanceChanged)
{
@@ -44,8 +43,14 @@ public partial class PrivacyBarViewModel : ViewModelBase
.Select(_ => walletViewModel.Wallet.GetPockets())
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(RefreshCoinsList);
+
+ IsEmpty = _coinsUpdated
+ .Select(_ => !Items.Any())
+ .ReplayLastActive();
}
+ public IObservable<bool> IsEmpty { get; }
+
public ObservableCollectionExtended<PrivacyBarItemViewModel> Items { get; } = new();
public Wallet Wallet { get; }
@@ -61,11 +66,6 @@ public partial class PrivacyBarViewModel : ViewModelBase
var coinCount = pockets.SelectMany(x => x.Coins).Count();
- Dispatcher.UIThread.Post(() =>
- {
- IsEmpty = true;
- });
-
if (coinCount == 0d)
{
return;
@@ -86,11 +86,6 @@ public partial class PrivacyBarViewModel : ViewModelBase
{
list.Add(item);
}
-
- Dispatcher.UIThread.Post(() =>
- {
- IsEmpty = false;
- });
}
private IEnumerable<PrivacyBarItemViewModel> CreateCoinSegments(IEnumerable<Pocket> pockets, int coinCount)

MODIFY
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/PrivacyBar/PrivacyBar.axaml
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/PrivacyBar/PrivacyBar.axaml
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="WalletWasabi.Fluent.Views.Wallets.Home.Tiles.PrivacyBar"
x:CompileBindings="True" x:DataType="tiles:PrivacyControlTileViewModel"
- IsVisible="{Binding !PrivacyBar.IsEmpty}">
+ IsVisible="{Binding !PrivacyBar.IsEmpty^}">
<Panel x:Name="Panel" DockPanel.Dock="Bottom" Margin="0 0 0 8">
<i:Interaction.Behaviors>
<behaviors:BoundsObserverBehavior Bounds="{Binding #Panel.Bounds, Mode=OneWay}"

Thanks to @SuperJMN, the hack is removed :)