initial implementation of optimise privacy screen.
ADD
WalletWasabi.Fluent/Converters/PrivacyOptimisationLevelConverters.cs
+using Avalonia;
+using Avalonia.Data.Converters;
+using Avalonia.Media;
+using WalletWasabi.Fluent.ViewModels.Wallets.Send;
+
+namespace WalletWasabi.Fluent.Converters
+{
+ public static class PrivacyOptimisationLevelConverters
+ {
+ public static readonly IValueConverter OptimisationLevelToBrushConverter =
+ new FuncValueConverter<PrivacyOptimisationLevel, IBrush?>(x =>
+ {
+ var resourceName = x == PrivacyOptimisationLevel.Standard
+ ? "PrivacyOptimisationLevelStandardBrush"
+ : "PrivacyOptimisationLevelBetterBrush";
+
+ if (Application.Current.Styles.TryGetResource(resourceName, out var resource) &&
+ resource is IBrush brush)
+ {
+ return brush;
+ }
+
+ return null;
+ });
+ }
+}
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/Styles/Themes/Base.axaml
WalletWasabi.Fluent/Styles/Themes/Base.axaml
<SolidColorBrush x:Key="PrivacyLevelExtremeBrush" Color="#89C67A" />
<SolidColorBrush x:Key="PrivacyLevelExtremeAltBrush" Color="#5B92D2" />
+ <SolidColorBrush x:Key="PrivacyOptimisationLevelStandardBrush" Color="#F9DA7D" />
+ <SolidColorBrush x:Key="PrivacyOptimisationLevelBetterBrush" Color="{StaticResource SystemAccentColor}" />
+
<SolidColorBrush x:Key="WarningMessageForeground">#FFDD00</SolidColorBrush>
<StaticResource x:Key="SystemControlErrorTextForegroundBrush" ResourceKey="SystemErrorTextColor" />
<SolidColorBrush x:Key="HyperLinkForeground">#00A2E8</SolidColorBrush>

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/OptimisePrivacyViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/OptimisePrivacyViewModel.cs
+using System.Collections.ObjectModel;
using WalletWasabi.Fluent.ViewModels.Navigation;
namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
@@ -5,5 +6,51 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
[NavigationMetaData(Title = "Optimise your privacy")]
public partial class OptimisePrivacyViewModel : RoutableViewModel
{
+ [AutoNotify] private ObservableCollection<PrivacySuggestionControlViewModel> _privacySuggestions;
+ [AutoNotify] private PrivacySuggestionControlViewModel _selectedPrivacySuggestion;
+
+ public OptimisePrivacyViewModel()
+ {
+ _privacySuggestions = new ObservableCollection<PrivacySuggestionControlViewModel>();
+
+ _privacySuggestions.Add(new PrivacySuggestionControlViewModel
+ {
+ Title = "1.13 BTC",
+ Caption = "Less",
+ Benefits = new[]
+ {
+ "Send 0.01% Less",
+ "Improved Privacy",
+ "Save on transaction fees"
+ },
+ OptimisationLevel = PrivacyOptimisationLevel.Better
+ });
+
+ _privacySuggestions.Add(new PrivacySuggestionControlViewModel
+ {
+ Title = "1.2 BTC",
+ Caption = "Standard",
+ Benefits = new[]
+ {
+ "Send Exact Amount"
+ },
+ OptimisationLevel = PrivacyOptimisationLevel.Standard
+ });
+
+ _privacySuggestions.Add(new PrivacySuggestionControlViewModel
+ {
+ Title = "1.27 BTC",
+ Caption = "Extra",
+ Benefits = new[]
+ {
+ "Send 0.01% More",
+ "Improved Privacy",
+ "Save on transaction fees"
+ },
+ OptimisationLevel = PrivacyOptimisationLevel.Better
+ });
+
+ SelectedPrivacySuggestion = _privacySuggestions[1];
+ }
}
}
\ No newline at end of file

ADD
WalletWasabi.Fluent/ViewModels/Wallets/Send/PrivacySuggestionControlViewModel.cs
+namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
+{
+ public enum PrivacyOptimisationLevel
+ {
+ Standard,
+ Better
+ }
+
+ public partial class PrivacySuggestionControlViewModel : ViewModelBase
+ {
+ [AutoNotify] private string _title;
+ [AutoNotify] private string _caption;
+ [AutoNotify] private string[] _benefits;
+ [AutoNotify] private PrivacyOptimisationLevel _optimisationLevel;
+ }
+}
\ No newline at end of file

ADD
WalletWasabi.Fluent/Views/Wallets/Send/PrivacySuggestionControl.axaml
+<UserControl xmlns="https://github.com/avaloniaui"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:conv="using:WalletWasabi.Fluent.Converters"
+ xmlns:i="clr-namespace:Avalonia.Xaml.Interactivity;assembly=Avalonia.Xaml.Interactivity"
+ xmlns:behaviors="using:WalletWasabi.Fluent.Behaviors"
+ xmlns:c="using:WalletWasabi.Fluent.Controls"
+ xmlns:vm="using:WalletWasabi.Fluent.ViewModels.Wallets.Send"
+ mc:Ignorable="d"
+ x:DataType="vm:PrivacySuggestionControlViewModel"
+ x:CompileBindings="True"
+ x:Class="WalletWasabi.Fluent.Views.Wallets.Send.PrivacySuggestionControl">
+ <StackPanel Spacing="30">
+ <Panel Height="120" Width="120">
+ <Ellipse Stroke="{Binding OptimisationLevel, Converter={x:Static conv:PrivacyOptimisationLevelConverters.OptimisationLevelToBrushConverter}}" StrokeThickness="2" />
+ <StackPanel Spacing="10" VerticalAlignment="Center">
+ <TextBlock Text="{Binding Title}" FontSize="20" HorizontalAlignment="Center" />
+ <TextBlock Text="{Binding Caption}" HorizontalAlignment="Center" Opacity="0.6" />
+ </StackPanel>
+ </Panel>
+ <Separator Height="1" Background="#FFFFFF" Opacity="0.2" />
+ <ItemsControl Items="{Binding Benefits}">
+ <ItemsControl.Styles>
+ <Style Selector="TextBlock">
+ <Setter Property="Opacity" Value="0.6" />
+ </Style>
+ </ItemsControl.Styles>
+ <ItemsControl.ItemsPanel>
+ <ItemsPanelTemplate>
+ <StackPanel Spacing="30" />
+ </ItemsPanelTemplate>
+ </ItemsControl.ItemsPanel>
+ </ItemsControl>
+ </StackPanel>
+</UserControl>

ADD
WalletWasabi.Fluent/Views/Wallets/Send/PrivacySuggestionControl.axaml.cs
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+
+namespace WalletWasabi.Fluent.Views.Wallets.Send
+{
+ public class PrivacySuggestionControl : UserControl
+ {
+ public PrivacySuggestionControl()
+ {
+ InitializeComponent();
+ }
+
+ private void InitializeComponent()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+ }
+}

initial implementation of optimise privacy screen.