use formatter and make stuff consistent with other BTC amount displays
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/WalletPieChartTileViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/WalletPieChartTileViewModel.cs
@@ -3,14 +3,14 @@ using System.Collections.Generic;
using System.Linq;
using System.Reactive;
using System.Reactive.Disposables;
-using NBitcoin;
+using WalletWasabi.Fluent.Helpers;
using WalletWasabi.Wallets;
namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles
{
public readonly struct DataLegend
{
- public DataLegend(Money amount, string label, string hexColor, double percentShare)
+ public DataLegend(string amount, string label, string hexColor, double percentShare)
{
Amount = amount;
Label = label;
@@ -18,7 +18,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles
PercentShare = percentShare;
}
- public Money Amount { get; }
+ public string Amount { get; }
public string Label { get; }
public string HexColor { get; }
public double PercentShare { get; }
@@ -26,8 +26,8 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles
public partial class WalletPieChartTileViewModel : TileViewModel
{
- private readonly Wallet _wallet;
private readonly IObservable<Unit> _balanceChanged;
+ private readonly Wallet _wallet;
[AutoNotify] private IList<(string color, double percentShare)>? _testDataPoints;
[AutoNotify] private IList<DataLegend>? _testDataPointsLegend;
@@ -57,10 +57,10 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles
var normalCoins = _wallet.Coins.FilterBy(x => x.HdPubKey.AnonymitySet < privateThreshold);
var totalCount = (double) _wallet.Coins.Count();
- var pcPrivate = (privateCoins.Count() / totalCount);
- var pcNormal = (normalCoins.Count() / totalCount);
+ var pcPrivate = privateCoins.Count() / totalCount;
+ var pcNormal = normalCoins.Count() / totalCount;
- TestDataPoints = new List<(string, double)>()
+ TestDataPoints = new List<(string, double)>
{
("#72BD81", pcPrivate),
("#F9DE7D", pcNormal)
@@ -68,8 +68,8 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles
TestDataPointsLegend = new List<DataLegend>
{
- new(privateCoins.TotalAmount(), "Private", "#72BD81", pcPrivate),
- new(normalCoins.TotalAmount(), "Not Private", "#F9DE7D", pcNormal)
+ new($"{privateCoins.TotalAmount().FormattedBtc()} BTC", "Private", "#72BD81", pcPrivate),
+ new($"{normalCoins.TotalAmount().FormattedBtc()} BTC", "Not Private", "#F9DE7D", pcNormal)
};
}
}

MODIFY
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/WalletPieChart/WalletPieChartLargeTileView.axaml
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/WalletPieChart/WalletPieChartLargeTileView.axaml
Height="10"
Fill="{Binding HexColor, Converter={x:Static converters:ColorStringConverters.HexColorToBrush}}" />
<TextBlock DockPanel.Dock="Left" HorizontalAlignment="Left"
- Text="{Binding Amount, StringFormat=BTC \{0\}, Converter={x:Static converters:MoneyConverters.MoneyToString}}" />
+ Text="{Binding Amount}" />
</DockPanel>
<DockPanel Grid.Column="1" Margin="0,8" Opacity="0.5">
<TextBlock DockPanel.Dock="Right" Margin="8,0,0,0" HorizontalAlignment="Right"

MODIFY
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/WalletPieChart/WalletPieChartMediumTileView.axaml
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/WalletPieChart/WalletPieChartMediumTileView.axaml
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="using:WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles"
- xmlns:controls="clr-namespace:WalletWasabi.Fluent.Controls"
xmlns:wallets="clr-namespace:WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles"
xmlns:converters="clr-namespace:WalletWasabi.Fluent.Converters"
mc:Ignorable="d" d:DesignWidth="330" d:DesignHeight="150"
Height="10"
Fill="{Binding HexColor, Converter={x:Static converters:ColorStringConverters.HexColorToBrush}}" />
<TextBlock DockPanel.Dock="Left" HorizontalAlignment="Left"
- Text="{Binding Amount, StringFormat=BTC \{0\}, Converter={x:Static converters:MoneyConverters.MoneyToString}}" />
- <TextBlock Opacity="0.5" DockPanel.Dock="Right" Margin="8,0,0,0" HorizontalAlignment="Right"
+ Text="{Binding Amount}" />
+ <TextBlock Opacity="0.5" DockPanel.Dock="Right" Margin="8,0,0,0"
+ HorizontalAlignment="Right"
Text="{Binding PercentShare, StringFormat=\{0:P1\}}" />
- <TextBlock Opacity="0.5" DockPanel.Dock="Right" HorizontalAlignment="Right" Text="{Binding Label}" />
+ <TextBlock Opacity="0.5" DockPanel.Dock="Right" HorizontalAlignment="Right"
+ Text="{Binding Label}" />
</DockPanel>
</DataTemplate>
</ItemsRepeater.ItemTemplate>

MODIFY
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/WalletPieChart/WalletPieChartWideTileView.axaml
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/WalletPieChart/WalletPieChartWideTileView.axaml
Height="10"
Fill="{Binding HexColor, Converter={x:Static converters:ColorStringConverters.HexColorToBrush}}" />
<TextBlock Grid.Column="1" FontSize="19" HorizontalAlignment="Left"
- Text="{Binding Amount, StringFormat=BTC \{0\}, Converter={x:Static converters:MoneyConverters.MoneyToString}}" />
+ Text="{Binding Amount}" />
<StackPanel Opacity="0.5" Grid.Row="1" Grid.Column="1" TextBlock.FontSize="13"
Orientation="Horizontal">
<TextBlock Text="{Binding Label}" />

use formatter and make stuff consistent with other BTC amount displays