refactor balance and privacy tile.
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/PrivacyControlTileViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/PrivacyControlTileViewModel.cs
@@ -22,6 +22,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles
[AutoNotify] private IList<(string color, double percentShare)>? _testDataPoints;
[AutoNotify] private IList<DataLegend>? _testDataPointsLegend;
[AutoNotify] private string _percentText;
+ [AutoNotify] private double _percent;
public PrivacyControlTileViewModel(WalletViewModel walletVm, IObservable<Unit> balanceChanged)
{
@@ -81,6 +82,8 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles
PercentText = $"{pcPrivate:P}";
+ Percent = pcPrivate * 100;
+
TestDataPoints = new List<(string, double)>
{
("#78A827", pcPrivate),

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/WalletBalanceTileViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/WalletBalanceTileViewModel.cs
using System;
+using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Reactive;
@@ -9,6 +10,7 @@ using NBitcoin;
using ReactiveUI;
using WalletWasabi.Wallets;
using WalletWasabi.Fluent.Helpers;
+using WalletWasabi.Fluent.Models;
using WalletWasabi.Fluent.ViewModels.Wallets.Home.History.HistoryItems;
namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles
@@ -26,6 +28,8 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles
[AutoNotify(SetterModifier = AccessModifier.Private)] private string? _recentTransactionDate;
[AutoNotify(SetterModifier = AccessModifier.Private)] private string? _recentTransactionStatus;
[AutoNotify(SetterModifier = AccessModifier.Private)] private bool _showRecentTransaction;
+ [AutoNotify] private IList<(string color, double percentShare)>? _testDataPoints;
+ [AutoNotify] private IList<DataLegend>? _testDataPointsLegend;
public WalletBalanceTileViewModel(Wallet wallet, IObservable<Unit> balanceChanged, ObservableCollection<HistoryItemViewModelBase> history)
{
@@ -60,11 +64,26 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles
var privateCoins = _wallet.Coins.FilterBy(x => x.HdPubKey.AnonymitySet >= privateThreshold);
var normalCoins = _wallet.Coins.FilterBy(x => x.HdPubKey.AnonymitySet < privateThreshold);
- BalancePrivateBtc = privateCoins.TotalAmount().ToDecimal(MoneyUnit.BTC)
+ var privateDecimalAmount = privateCoins.TotalAmount();
+ var totalDecimalAmount = _wallet.Coins.TotalAmount();
+
+ BalancePrivateBtc = privateDecimalAmount
.FormattedBtc() + " BTC";
BalanceNonPrivateBtc = normalCoins.TotalAmount().ToDecimal(MoneyUnit.BTC)
.FormattedBtc() + " BTC";
+
+ var pcPrivate = _wallet.Coins.TotalAmount().ToDecimal(MoneyUnit.BTC) == 0M ? 0d : (double)(privateDecimalAmount.ToDecimal(MoneyUnit.BTC) / totalDecimalAmount.ToDecimal(MoneyUnit.BTC));
+
+ TestDataPoints = new List<(string, double)>
+ {
+ ("#78A827", pcPrivate)
+ };
+
+ TestDataPointsLegend = new List<DataLegend>
+ {
+ new(privateDecimalAmount, "Private", "#78A827", pcPrivate)
+ };
}
private void UpdateRecentTransaction()

MODIFY
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/PrivacyControlTileView.axaml
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/PrivacyControlTileView.axaml
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="clr-namespace:WalletWasabi.Fluent.Controls"
xmlns:tiles="clr-namespace:WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles"
- xmlns:converters="clr-namespace:WalletWasabi.Fluent.Converters"
- xmlns:models="clr-namespace:WalletWasabi.Fluent.Models"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:CompileBindings="True" x:DataType="tiles:PrivacyControlTileViewModel"
x:Class="WalletWasabi.Fluent.Views.Wallets.Home.Tiles.PrivacyControlTileView">
- <controls:TileControl TileSize="Large">
+ <controls:TileControl TileSize="{Binding CurrentTileSize}">
+ <controls:TileControl.LargeSizeContent>
<DockPanel>
<DockPanel.Styles>
<Style Selector="Button">
<TextBlock Text="Privacy Level" DockPanel.Dock="Top" />
- <DockPanel DockPanel.Dock="Bottom">
- <StackPanel Spacing="10" DockPanel.Dock="Left" Orientation="Horizontal">
+ <StackPanel Spacing="10" DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Center">
<Button Classes="plain" Cursor="Hand" Command="{Binding BoostPrivacyCommand}"
IsVisible="{Binding BoostButtonVisible}"
ToolTip.Tip="Boost Privacy">
+ <StackPanel Orientation="Horizontal" Spacing="10">
<PathIcon Data="{StaticResource rocket_regular}" />
+ <TextBlock Text="Boost Privacy" />
+ </StackPanel>
</Button>
<Button Classes="plain" Cursor="Hand" Command="{Binding BoostPrivacyCommand}"
IsVisible="{Binding IsBoosting}"
<PathIcon Data="{StaticResource pause_regular}" />
</Button>
</StackPanel>
- <ItemsControl DockPanel.Dock="Bottom" Items="{Binding TestDataPointsLegend}" HorizontalAlignment="Right">
- <ItemsControl.ItemTemplate>
- <DataTemplate x:DataType="models:DataLegend">
- <StackPanel Orientation="Horizontal" Spacing="10" TextBlock.FontFamily="{StaticResource MonospacedFont}">
- <Ellipse Margin="0,0,8,0" HorizontalAlignment="Left" Width="10"
- Height="10"
- Fill="{Binding HexColor, Converter={x:Static converters:ColorStringConverters.HexColorToBrush}}" />
-
- <controls:PrivacyContentControl NumberOfPrivacyChars="9" Margin="0 0 8 0"
- Content="{Binding Amount, Converter={x:Static converters:MoneyConverters.ToFormattedString}}" />
-
- <TextBlock DockPanel.Dock="Right" HorizontalAlignment="Right" Text="{Binding Label}" Margin="0 0 8 0" />
- </StackPanel>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- <ItemsControl.ItemsPanel>
- <ItemsPanelTemplate>
- <StackPanel />
- </ItemsPanelTemplate>
- </ItemsControl.ItemsPanel>
- </ItemsControl>
- </DockPanel>
<Separator DockPanel.Dock="Bottom" Margin="0 10" />
HorizontalAlignment="Center" VerticalAlignment="Center" />
<controls:ProgressRing IsIndeterminate="True" Classes.visible="{Binding IsBoosting}" />
- <TextBlock Text="{Binding PercentText}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="36" />
+ <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding PercentText}" FontSize="36" />
</Panel>
+ </DockPanel>
+ </controls:TileControl.LargeSizeContent>
+ <DockPanel>
+ <DockPanel.Styles>
+ <Style Selector="Button">
+ <Setter Property="HorizontalAlignment" Value="Center" />
+ <Setter Property="VerticalAlignment" Value="Center" />
+ </Style>
+
+ <Style Selector="controls|ProgressRing.visible, controls|RingChartControl.visible">
+ <Setter Property="Opacity" Value="1" />
+ </Style>
+ <Style Selector="controls|ProgressRing, controls|RingChartControl">
+ <Setter Property="Opacity" Value="0" />
+ <Setter Property="Transitions">
+ <Transitions>
+ <DoubleTransition Property="Opacity" Duration="0:0:0.5" />
+ </Transitions>
+ </Setter>
+ </Style>
+ </DockPanel.Styles>
+
+ <TextBlock Text="Privacy Level" DockPanel.Dock="Top" />
+
+ <StackPanel Spacing="10" DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Center">
+ <Button Classes="plain" Cursor="Hand" Command="{Binding BoostPrivacyCommand}"
+ IsVisible="{Binding BoostButtonVisible}"
+ ToolTip.Tip="Boost Privacy">
+ <StackPanel Orientation="Horizontal" Spacing="10">
+ <PathIcon Data="{StaticResource rocket_regular}" />
+ <TextBlock Text="Boost Privacy" />
+ </StackPanel>
+ </Button>
+ <Button Classes="plain" Cursor="Hand" Command="{Binding BoostPrivacyCommand}"
+ IsVisible="{Binding IsBoosting}"
+ ToolTip.Tip="Stop Privacy Boost">
+ <PathIcon Data="{StaticResource stop_regular}" />
+ </Button>
+ <Button Classes="plain" Cursor="Hand" IsVisible="{Binding IsAutoCoinJoinEnabled}"
+ ToolTip.Tip="Pause Automatic CoinJoins">
+ <PathIcon Data="{StaticResource pause_regular}" />
+ </Button>
+ </StackPanel>
+
+ <ProgressBar IsIndeterminate="{Binding IsBoosting}" Value="{Binding Percent}" DockPanel.Dock="Bottom" Margin="0 10" />
+ <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding PercentText}" FontSize="36" />
</DockPanel>
</controls:TileControl>
</UserControl>
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/WalletBalance/WalletBalanceMediumTileView.axaml
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/WalletBalance/WalletBalanceMediumTileView.axaml
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:models="clr-namespace:WalletWasabi.Fluent.Models"
+ xmlns:converters="clr-namespace:WalletWasabi.Fluent.Converters"
mc:Ignorable="d" d:DesignWidth="330" d:DesignHeight="150"
x:CompileBindings="True" x:DataType="vm:WalletBalanceTileViewModel"
x:Class="WalletWasabi.Fluent.Views.Wallets.Home.Tiles.WalletBalance.WalletBalanceMediumTileView">
<DockPanel>
<TextBlock Text="Balance" DockPanel.Dock="Top" />
+ <StackPanel DockPanel.Dock="Bottom" Spacing="10" Margin="0 5 0 0">
+ <Separator />
+ <ItemsControl DockPanel.Dock="Bottom" VerticalAlignment="Center" HorizontalAlignment="Right" Items="{Binding TestDataPointsLegend}" >
+ <ItemsControl.ItemTemplate>
+ <DataTemplate x:DataType="models:DataLegend">
+ <StackPanel Orientation="Horizontal" Spacing="10" TextBlock.FontFamily="{StaticResource MonospacedFont}">
+ <Ellipse Margin="0,0,8,0" HorizontalAlignment="Left" Width="10"
+ Height="10"
+ Fill="{Binding HexColor, Converter={x:Static converters:ColorStringConverters.HexColorToBrush}}" />
+
+ <controls:PrivacyContentControl NumberOfPrivacyChars="9" Margin="0 0 8 0"
+ Content="{Binding Amount, Converter={x:Static converters:MoneyConverters.ToFormattedString}}" />
+
+ <TextBlock DockPanel.Dock="Right" HorizontalAlignment="Right" Text="{Binding Label}" Margin="0 0 8 0" />
+ </StackPanel>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ <ItemsControl.ItemsPanel>
+ <ItemsPanelTemplate>
+ <StackPanel />
+ </ItemsPanelTemplate>
+ </ItemsControl.ItemsPanel>
+ </ItemsControl>
+ </StackPanel>
+
<StackPanel DockPanel.Dock="Left" Orientation="Horizontal" Spacing="16">
- <Viewbox Height="47" Width="47" DockPanel.Dock="Left">
+ <Viewbox Height="40" Width="40" DockPanel.Dock="Left">
<Panel>
<Ellipse Stroke="{DynamicResource SystemAccentColor}" StrokeThickness="4"
Height="115" Width="115" />

refactor balance and privacy tile.