add manual CJ profile and dialog
RENAME
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/CoinJoinProfileViewModel.cs
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/CoinJoinProfileViewModelBase.cs
using Avalonia.Media;
-using WalletWasabi.Blockchain.Keys;
namespace WalletWasabi.Fluent.ViewModels.CoinJoinProfiles;
-public abstract class CoinJoinProfileViewModel : ViewModelBase
+public abstract class CoinJoinProfileViewModelBase : ViewModelBase
{
public abstract string Title { get; }
+
public abstract string Description { get; }
+
public abstract IImage Icon { get; }
public virtual int MinAnonScoreTarget { get; } = 5;
public virtual int MaxAnonScoreTarget { get; } = 10;
- public abstract int FeeTargetAvarageTimeFrameHours { get; }
+
+ public abstract int FeeTargetAverageTimeFrameHours { get; }
}

MODIFY
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/CoinJoinProfilesViewModel.cs
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/CoinJoinProfilesViewModel.cs
using ReactiveUI;
using System.Collections.Generic;
using System.Reactive.Disposables;
+using System.Threading.Tasks;
using System.Windows.Input;
using WalletWasabi.Blockchain.Keys;
using WalletWasabi.Fluent.ViewModels.AddWallet;
+using WalletWasabi.Fluent.ViewModels.Dialogs;
using WalletWasabi.Fluent.ViewModels.Navigation;
namespace WalletWasabi.Fluent.ViewModels.CoinJoinProfiles;
@@ -11,7 +13,7 @@ namespace WalletWasabi.Fluent.ViewModels.CoinJoinProfiles;
[NavigationMetaData(Title = "CoinJoin Profiles")]
public partial class CoinJoinProfilesViewModel : RoutableViewModel
{
- [AutoNotify] private CoinJoinProfileViewModel _selectedProfile;
+ [AutoNotify] private CoinJoinProfileViewModelBase _selectedProfile;
public CoinJoinProfilesViewModel(KeyManager keyManager)
{
@@ -29,16 +31,22 @@ public partial class CoinJoinProfilesViewModel : RoutableViewModel
_selectedProfile = privateProfile;
- ManualSetupCommand = ReactiveCommand.Create(OnManualSetup);
+ ManualSetupCommand = ReactiveCommand.CreateFromTask(async () => await OnManualSetupAsync());
}
public ICommand ManualSetupCommand { get; }
- public List<CoinJoinProfileViewModel> Profiles { get; }
+ public List<CoinJoinProfileViewModelBase> Profiles { get; }
- private void OnManualSetup()
+ private async Task OnManualSetupAsync()
{
+ var dialog = new ManualCoinJoinProfileDialogViewModel();
+ var dialogResult = await NavigateDialogAsync(dialog, NavigationTarget.CompactDialogScreen);
+
+ if (dialogResult.Result is { })
+ {
+ }
}
private void OnNext(KeyManager keyManager)
@@ -46,7 +54,7 @@ public partial class CoinJoinProfilesViewModel : RoutableViewModel
var selected = SelectedProfile;
keyManager.SetAnonScoreTargets(selected.MinAnonScoreTarget, selected.MaxAnonScoreTarget, toFile: false);
- keyManager.SetFeeTargetAvarageTimeFrame(selected.FeeTargetAvarageTimeFrameHours, toFile: false);
+ keyManager.SetFeeTargetAvarageTimeFrame(selected.FeeTargetAverageTimeFrameHours, toFile: false);
Navigate().To(new AddedWalletPageViewModel(keyManager));
}

MODIFY
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/EconomyCoinJoinProfile.cs
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/EconomyCoinJoinProfile.cs
@@ -8,7 +8,7 @@ using WalletWasabi.Fluent.Helpers;
namespace WalletWasabi.Fluent.ViewModels.CoinJoinProfiles;
-internal class EconomyCoinJoinProfile : CoinJoinProfileViewModel
+internal class EconomyCoinJoinProfile : CoinJoinProfileViewModelBase
{
public override string Title => "Economy";
@@ -16,5 +16,5 @@ internal class EconomyCoinJoinProfile : CoinJoinProfileViewModel
public override IImage Icon => AssetHelpers.GetBitmapAsset($"avares://WalletWasabi.Fluent/Assets/WalletIcons/{ThemeHelper.CurrentTheme}/ledger.png");
- public override int FeeTargetAvarageTimeFrameHours => 168; // One week avarage.
+ public override int FeeTargetAverageTimeFrameHours => 168; // One week avarage.
}
\ No newline at end of file

ADD
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/ManualCoinJoinProfile.cs
+using Avalonia.Media;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WalletWasabi.Fluent.Helpers;
+
+namespace WalletWasabi.Fluent.ViewModels.CoinJoinProfiles;
+
+public class ManualCoinJoinProfile : CoinJoinProfileViewModelBase
+{
+ public ManualCoinJoinProfile(int minAnonScoreTarget, int maxAnonScoreTarget, int feeTargetAverageTimeFrameHours)
+ {
+ MinAnonScoreTarget = minAnonScoreTarget;
+ MaxAnonScoreTarget = maxAnonScoreTarget;
+ FeeTargetAverageTimeFrameHours = feeTargetAverageTimeFrameHours;
+ }
+
+ public override string Title => "Economy";
+
+ public override string Description => "very Economy";
+
+ public override IImage Icon => AssetHelpers.GetBitmapAsset($"avares://WalletWasabi.Fluent/Assets/WalletIcons/{ThemeHelper.CurrentTheme}/ledger.png");
+
+ public override int MinAnonScoreTarget { get; }
+
+ public override int MaxAnonScoreTarget { get; }
+
+ public override int FeeTargetAverageTimeFrameHours { get; }
+}

MODIFY
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/PrivateCoinJoinProfile.cs
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/PrivateCoinJoinProfile.cs
@@ -8,7 +8,7 @@ using WalletWasabi.Fluent.Helpers;
namespace WalletWasabi.Fluent.ViewModels.CoinJoinProfiles;
-internal class PrivateCoinJoinProfile : CoinJoinProfileViewModel
+internal class PrivateCoinJoinProfile : CoinJoinProfileViewModelBase
{
public override string Title => "Private";
@@ -18,5 +18,5 @@ internal class PrivateCoinJoinProfile : CoinJoinProfileViewModel
public override int MinAnonScoreTarget => 50;
public override int MaxAnonScoreTarget => 100;
- public override int FeeTargetAvarageTimeFrameHours => 0;
+ public override int FeeTargetAverageTimeFrameHours => 0;
}
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/SpeedyCoinJoinProfile.cs
WalletWasabi.Fluent/ViewModels/CoinJoinProfiles/SpeedyCoinJoinProfile.cs
@@ -8,7 +8,7 @@ using WalletWasabi.Fluent.Helpers;
namespace WalletWasabi.Fluent.ViewModels.CoinJoinProfiles;
-internal class SpeedyCoinJoinProfile : CoinJoinProfileViewModel
+internal class SpeedyCoinJoinProfile : CoinJoinProfileViewModelBase
{
public override string Title => "Speedy";
@@ -16,5 +16,5 @@ internal class SpeedyCoinJoinProfile : CoinJoinProfileViewModel
public override IImage Icon => AssetHelpers.GetBitmapAsset($"avares://WalletWasabi.Fluent/Assets/WalletIcons/{ThemeHelper.CurrentTheme}/trezor.png");
- public override int FeeTargetAvarageTimeFrameHours => 0;
+ public override int FeeTargetAverageTimeFrameHours => 0;
}
\ No newline at end of file

ADD
WalletWasabi.Fluent/ViewModels/Dialogs/ManualCoinJoinProfileDialogViewModel.cs
+using WalletWasabi.Fluent.ViewModels.CoinJoinProfiles;
+using WalletWasabi.Fluent.ViewModels.Dialogs.Base;
+
+namespace WalletWasabi.Fluent.ViewModels.Dialogs;
+
+[NavigationMetaData(Title = "Manual CoinJoin Profile")]
+public partial class ManualCoinJoinProfileDialogViewModel : DialogViewModelBase<ManualCoinJoinProfile?>
+{
+ public ManualCoinJoinProfileDialogViewModel()
+ {
+ SetupCancel(enableCancel: true, enableCancelOnEscape: true, enableCancelOnPressed: true);
+ EnableBack = false;
+ }
+}

MODIFY
WalletWasabi.Fluent/Views/CoinJoinProfiles/CoinJoinProfileControl.axaml
WalletWasabi.Fluent/Views/CoinJoinProfiles/CoinJoinProfileControl.axaml
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="using:WalletWasabi.Fluent.ViewModels.CoinJoinProfiles"
mc:Ignorable="d" d:DesignWidth="300" d:DesignHeight="450"
- x:DataType="vm:CoinJoinProfileViewModel"
+ x:DataType="vm:CoinJoinProfileViewModelBase"
ClipToBounds="False"
x:CompileBindings="True"
x:Class="WalletWasabi.Fluent.Views.CoinJoinProfiles.CoinJoinProfileControl">

MODIFY
WalletWasabi.Fluent/Views/CoinJoinProfiles/CoinJoinProfilesView.axaml
WalletWasabi.Fluent/Views/CoinJoinProfiles/CoinJoinProfilesView.axaml
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.DataTemplates>
- <DataTemplate DataType="vm:CoinJoinProfileViewModel">
+ <DataTemplate DataType="vm:CoinJoinProfileViewModelBase">
<c:SuggestionItem>
<prof:CoinJoinProfileControl />
</c:SuggestionItem>

ADD
WalletWasabi.Fluent/Views/Dialogs/ManualCoinJoinProfileDialogView.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:c="using:WalletWasabi.Fluent.Controls"
+ xmlns:dialogs="clr-namespace:WalletWasabi.Fluent.ViewModels.Dialogs"
+ mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="270"
+ x:DataType="dialogs:ManualCoinJoinProfileDialogViewModel"
+ x:CompileBindings="True"
+ x:Class="WalletWasabi.Fluent.Views.Dialogs.ManualCoinJoinProfileDialogView">
+ <c:ContentArea Width="500" Height="300"
+ Title="{Binding Title}"
+ CancelContent="Cancel"
+ EnableCancel="{Binding EnableCancel}"
+ EnableBack="{Binding EnableBack}"
+ EnableNext="True" NextContent="Done">
+
+ </c:ContentArea>
+</UserControl>

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

add manual CJ profile and dialog