add binding actual balance to tile.
ADD
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/WalletBalanceTileViewModel.cs
+using NBitcoin;
+using WalletWasabi.Wallets;
+using ReactiveUI;
+using WalletWasabi.Fluent.Helpers;
+
+namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles
+{
+ public partial class WalletBalanceTileViewModel : ViewModelBase
+ {
+ [AutoNotify] private string _balanceBtc;
+ [AutoNotify] private string _balanceFiat;
+
+ public WalletBalanceTileViewModel(Wallet wallet)
+ {
+ Wallet wallet1 = wallet;
+
+ _balanceBtc = wallet1.Coins.Confirmed().TotalAmount().ToDecimal(MoneyUnit.BTC).FormattedBtc() + " BTC";
+ _balanceFiat = wallet1.Coins.Confirmed().TotalAmount().ToDecimal(MoneyUnit.BTC)
+ .GenerateFiatText(wallet.Synchronizer.UsdExchangeRate, "USD");
+ }
+
+
+ }
+}
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModel.cs
@@ -8,6 +8,7 @@ using System.Reactive.Linq;
using System.Threading.Tasks;
using WalletWasabi.Fluent.ViewModels.Wallets.HardwareWallet;
using WalletWasabi.Fluent.ViewModels.Wallets.History;
+using WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles;
using WalletWasabi.Fluent.ViewModels.Wallets.WatchOnlyWallet;
using WalletWasabi.Gui;
using WalletWasabi.Logging;
@@ -46,6 +47,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
.DisposeWith(Disposables);
History = new HistoryViewModel(wallet);
+ BalanceTile = new WalletBalanceTileViewModel(wallet);
}
private CompositeDisposable Disposables { get; set; }
@@ -54,6 +56,8 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
public HistoryViewModel History { get; }
+ public WalletBalanceTileViewModel BalanceTile { get; }
+
protected override void OnNavigatedTo(bool isInHistory, CompositeDisposable disposables)
{
base.OnNavigatedTo(isInHistory, disposables);

MODIFY
WalletWasabi.Fluent/Views/Wallets/WalletView.axaml
WalletWasabi.Fluent/Views/Wallets/WalletView.axaml
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:c="clr-namespace:WalletWasabi.Fluent.Controls"
+ xmlns:tiles="using:WalletWasabi.Fluent.Views.Wallets.Home.Tiles"
xmlns:wallets="clr-namespace:WalletWasabi.Fluent.ViewModels.Wallets"
xmlns:history="clr-namespace:WalletWasabi.Fluent.Views.Wallets.History"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:DataType="wallets:WalletViewModel"
x:CompileBindings="True"
x:Class="WalletWasabi.Fluent.Views.Wallets.WalletView">
- <c:ContentArea Title="{Binding Title}"
- Caption="Wallet Home Page, currently under construction." >
- <history:HistoryTable DataContext="{Binding History}" MaxWidth="1000" Height="300" HorizontalAlignment="Stretch" VerticalAlignment="Top"/>
+ <c:ContentArea Title="{Binding Title}">
+ <DockPanel>
+ <Grid ColumnDefinitions="*,*,*,*,*,*" DockPanel.Dock="Top">
+ <tiles:WalletBalanceTileView Grid.ColumnSpan="3" HorizontalAlignment="Left"
+ DataContext="{Binding BalanceTile}" Width="310" Height="150" />
+ </Grid>
+ <history:HistoryTable DataContext="{Binding History}" MaxWidth="1000" Height="300"
+ HorizontalAlignment="Stretch" VerticalAlignment="Top" />
+ </DockPanel>
</c:ContentArea>
</UserControl>
\ No newline at end of file

add binding actual balance to tile.