Rename and add properties for empty wallet and transaction history
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryViewModel.cs
@@ -27,7 +27,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.History
private readonly object _transactionListLock = new();
[AutoNotify] private HistoryItemViewModel? _selectedItem;
- [AutoNotify] private bool _isWalletEmpty;
+ [AutoNotify(SetterModifier = AccessModifier.Private)] private bool _isTransactionHistoryEmpty;
public HistoryViewModel(WalletViewModel walletViewModel, IObservable<Unit> updateTrigger)
{
@@ -38,7 +38,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.History
_unfilteredTransactions = new ObservableCollectionExtended<HistoryItemViewModel>();
this.WhenAnyValue(x => x.UnfilteredTransactions.Count)
- .Subscribe(x => IsWalletEmpty = x <= 0);
+ .Subscribe(x => IsTransactionHistoryEmpty = x <= 0);
var sortDescription = DataGridSortDescription.FromPath(nameof(HistoryItemViewModel.OrderIndex), ListSortDirection.Descending);
CollectionView = new DataGridCollectionView(Transactions);

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModel.cs
@@ -38,6 +38,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
[AutoNotify(SetterModifier = AccessModifier.Private)] private bool _isSmallLayout;
[AutoNotify(SetterModifier = AccessModifier.Private)] private bool _isNormalLayout;
[AutoNotify(SetterModifier = AccessModifier.Private)] private bool _isWideLayout;
+ [AutoNotify(SetterModifier = AccessModifier.Private)] private bool _isWalletBalanceZero;
protected WalletViewModel(Wallet wallet) : base(wallet)
{
@@ -57,6 +58,10 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
.Throttle(TimeSpan.FromSeconds(0.1))
.ObserveOn(RxApp.MainThreadScheduler);
+ balanceChanged
+ .Subscribe(_ => IsWalletBalanceZero = wallet.Coins.TotalAmount() == Money.Zero)
+ .DisposeWith(Disposables);
+
History = new HistoryViewModel(this, balanceChanged);
_smallLayoutHeightBreakpoint = 650;

MODIFY
WalletWasabi.Fluent/Views/Wallets/WalletView.axaml
WalletWasabi.Fluent/Views/Wallets/WalletView.axaml
<TextBlock Text="Broadcast" />
</StackPanel>
</Button>
- <Button Classes="function" Command="{Binding SendCommand}">
+ <Button Classes="function"
+ IsVisible="{Binding !IsWalletBalanceZero}"
+ Command="{Binding SendCommand}">
<StackPanel Orientation="Horizontal" Spacing="15">
<PathIcon Data="{StaticResource wallet_action_send}" />
<TextBlock Text="Send" />
</StackPanel>
</Button>
- <Button Classes="function" Command="{Binding ReceiveCommand}">
+ <Button Classes="function"
+ IsVisible="{Binding !IsWalletBalanceZero}"
+ Command="{Binding ReceiveCommand}">
<StackPanel Orientation="Horizontal" Spacing="15">
<PathIcon Data="{StaticResource wallet_action_receive}" />
<TextBlock Text="Receive" />
<Panel Classes.smallLayout="{Binding IsSmallLayout}"
Classes.normalLayout="{Binding IsNormalLayout}"
Classes.wideLayout="{Binding IsWideLayout}"
- Classes.isEmptyWallet="{Binding History.IsWalletEmpty}">
+ Classes.isEmptyWallet="{Binding IsWalletBalanceZero}">
<Panel.Styles>
<Style Selector="Panel.smallLayout">
<Setter Property="HorizontalAlignment" Value="Left"/>
</Style>
</Panel.Styles>
<ScrollViewer Name="ScrollViewer"
- IsVisible="{Binding !History.IsWalletEmpty}"
+ IsVisible="{Binding !IsWalletBalanceZero}"
Classes.smallLayout="{Binding IsSmallLayout}"
Classes.normalLayout="{Binding IsNormalLayout}"
Classes.wideLayout="{Binding IsWideLayout}">
Margin="6"
Padding="16"
BoxShadow="{DynamicResource InfoBoxShadow}"
- DataContext="{Binding History}"
- IsVisible="{Binding IsWalletEmpty}">
- <Label Content="Please click Send or Receive buttons to start using your wallet."
+ IsVisible="{Binding IsWalletBalanceZero}">
+ <StackPanel>
+ <Label Content="Since this is a empty wallet, there isn't a lot going on here. Click an option below to receive BitCoin."
+ Classes="wrap center"
+ MaxWidth="400"
+ HorizontalAlignment="Center"
+ VerticalAlignment="Center"/>
+ <Button Classes="function"
+ Command="{Binding ReceiveCommand}"
HorizontalAlignment="Center"
VerticalAlignment="Center">
- <Label.Styles>
- <Style Selector="Label > AccessText">
- <Setter Property="TextWrapping" Value="Wrap"/>
- </Style>
- </Label.Styles>
- </Label>
+ <StackPanel Orientation="Horizontal" Spacing="15">
+ <PathIcon Data="{StaticResource wallet_action_receive}" />
+ <TextBlock Text="Receive" />
+ </StackPanel>
+ </Button>
+ </StackPanel>
</Border>
</Panel>
<Panel>
<history:HistoryTable Name="HistoryTable"
DataContext="{Binding History}"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
- IsVisible="{Binding !IsWalletEmpty}"/>
+ IsVisible="{Binding !IsTransactionHistoryEmpty}"/>
<Border ClipToBounds="False"
CornerRadius="5"
Background="{DynamicResource TileRegionColor}"
Padding="16"
BoxShadow="{DynamicResource InfoBoxShadow}"
DataContext="{Binding History}"
- IsVisible="{Binding IsWalletEmpty}">
+ IsVisible="{Binding IsTransactionHistoryEmpty}">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
- <!--<ContentControl Template="{DynamicResource placeholder_empty_wallet}"
- HorizontalAlignment="Center"
- VerticalAlignment="Center" />-->
<Image Width="234" Height="110" HorizontalAlignment="Center" VerticalAlignment="Center">
<Image.Source>
<DrawingImage Drawing="{StaticResource history_table_empty_wallet}"/>

Rename and add properties for empty wallet and transaction history