classes to separate file
ADD
WalletWasabi.Fluent/ViewModels/Wallets/Send/LabelSelectionViewModel.cs
+using System.Collections.Generic;
+using System.Linq;
+using NBitcoin;
+using ReactiveUI;
+using WalletWasabi.Blockchain.Analysis.Clustering;
+using WalletWasabi.Fluent.Models;
+
+namespace WalletWasabi.Fluent.ViewModels.Wallets.Send;
+
+public class LabelSelectionViewModel : ViewModelBase
+{
+ private readonly Money _targetAmount;
+
+ public LabelSelectionViewModel(Money targetAmount)
+ {
+ _targetAmount = targetAmount;
+ }
+
+ public Pocket[] AllPocket { get; set; } = Array.Empty<Pocket>();
+
+ public IEnumerable<LabelViewModel> AllLabelViewModel { get; set; } = Array.Empty<LabelViewModel>();
+
+ public IEnumerable<LabelViewModel> LabelsWhiteList => AllLabelViewModel.Where(x => !x.IsBlackListed);
+
+ public IEnumerable<LabelViewModel> LabelsBlackList => AllLabelViewModel.Where(x => x.IsBlackListed);
+
+ public IEnumerable<Pocket> GetUsedPockets() => AllPocket.Where(x => LabelsWhiteList.Any(y => x.Labels.Contains(y.Value)));
+
+ public void Reset(Pocket[] pockets)
+ {
+ AllPocket = pockets;
+
+ var allLabels = SmartLabel.Merge(AllPocket.Select(x => x.Labels));
+ AllLabelViewModel = allLabels.Select(x => new LabelViewModel(this, x)).ToArray();
+
+ OnSelectionChanged();
+ }
+
+ public LabelViewModel[] GetAssociatedLabels(LabelViewModel labelViewModel)
+ {
+ if (labelViewModel.IsBlackListed)
+ {
+ var associatedPockets = AllPocket.Where(x => x.Labels.Contains(labelViewModel.Value)).OrderBy(x => x.Labels.Count());
+ var smallestAssociatedPocket = associatedPockets.First();
+ var allAssociatedLabels = smallestAssociatedPocket.Labels;
+ var affectedLabelViewModels = AllLabelViewModel.Where(x => x.IsBlackListed == labelViewModel.IsBlackListed && allAssociatedLabels.Contains(x.Value));
+ return affectedLabelViewModels.ToArray();
+ }
+ else
+ {
+ var associatedPockets = AllPocket.Where(x => x.Labels.Contains(labelViewModel.Value));
+ var notAssociatedPockets = AllPocket.Except(associatedPockets);
+ var allNotAssociatedLabels = SmartLabel.Merge(notAssociatedPockets.Select(x => x.Labels));
+ var affectedLabelViewModels = AllLabelViewModel.Where(x => x.IsBlackListed == labelViewModel.IsBlackListed && !allNotAssociatedLabels.Contains(x.Value));
+ return affectedLabelViewModels.ToArray();
+ }
+ }
+
+ public void OnPointerOver(LabelViewModel labelViewModel, bool isPointerOver)
+ {
+ if (!isPointerOver)
+ {
+ foreach (LabelViewModel lvm in AllLabelViewModel)
+ {
+ lvm.IsHighlighted = false;
+ }
+
+ return;
+ }
+
+ var affectedLabelViewModels = GetAssociatedLabels(labelViewModel);
+
+ foreach (var lvm in affectedLabelViewModels)
+ {
+ lvm.IsHighlighted = isPointerOver;
+ }
+ }
+
+ internal void SwapLabel(LabelViewModel labelViewModel)
+ {
+ var affectedLabelViewModels = GetAssociatedLabels(labelViewModel);
+
+ foreach (var lvm in affectedLabelViewModels)
+ {
+ lvm.IsBlackListed = !lvm.IsBlackListed;
+ }
+
+ OnSelectionChanged();
+ }
+
+ private void OnSelectionChanged()
+ {
+ var sumOfWhiteList = AllPocket.Where(x => LabelsWhiteList.Any(y => x.Labels.Contains(y.Value))).Sum(x => x.Amount);
+
+ foreach (var labelViewModel in LabelsWhiteList)
+ {
+ var sumOfLabelsPockets = AllPocket.Where(x => x.Labels.Contains(labelViewModel.Value)).Sum(x => x.Amount);
+
+ labelViewModel.MustHave = sumOfWhiteList - sumOfLabelsPockets < _targetAmount;
+ }
+
+ this.RaisePropertyChanged(nameof(LabelsWhiteList));
+ this.RaisePropertyChanged(nameof(LabelsBlackList));
+ }
+}

ADD
WalletWasabi.Fluent/ViewModels/Wallets/Send/LabelViewModel.cs
+using System.Reactive.Linq;
+using System.Windows.Input;
+using ReactiveUI;
+
+namespace WalletWasabi.Fluent.ViewModels.Wallets.Send;
+
+public partial class LabelViewModel : ViewModelBase
+{
+ [AutoNotify] private bool _isBlackListed;
+ [AutoNotify] private bool _isPointerOver;
+ [AutoNotify] private bool _isHighlighted;
+ [AutoNotify] private bool _mustHave;
+
+ public LabelViewModel(LabelSelectionViewModel owner, string label)
+ {
+ Value = label;
+
+ this.WhenAnyValue(x => x.IsPointerOver)
+ .Skip(1)
+ .Subscribe(isPointerOver => owner.OnPointerOver(this, isPointerOver));
+
+ ClickedCommand = ReactiveCommand.Create(() => owner.SwapLabel(this),
+ this.WhenAnyValue(x => x.MustHave, x => x.IsBlackListed).Select(x => x.Item2 || !x.Item1 && !x.Item2));
+ }
+
+ public string Value { get; }
+
+ public ICommand ClickedCommand { get; }
+}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/PrivacyControlViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/PrivacyControlViewModel.cs
@@ -2,10 +2,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Reactive.Disposables;
using System.Reactive.Linq;
-using System.Windows.Input;
-using NBitcoin;
using ReactiveUI;
-using WalletWasabi.Blockchain.Analysis.Clustering;
using WalletWasabi.Blockchain.TransactionOutputs;
using WalletWasabi.Fluent.Helpers;
using WalletWasabi.Fluent.Models;
@@ -14,127 +11,6 @@ using WalletWasabi.Wallets;
namespace WalletWasabi.Fluent.ViewModels.Wallets.Send;
-public partial class LabelSelectionViewModel : ViewModelBase
-{
- private readonly Money _targetAmount;
-
- public LabelSelectionViewModel(Money targetAmount)
- {
- _targetAmount = targetAmount;
- }
-
- public Pocket[] AllPocket { get; set; } = Array.Empty<Pocket>();
-
- public IEnumerable<LabelViewModel> AllLabelViewModel { get; set; } = Array.Empty<LabelViewModel>();
-
- public IEnumerable<LabelViewModel> LabelsWhiteList => AllLabelViewModel.Where(x => !x.IsBlackListed);
-
- public IEnumerable<LabelViewModel> LabelsBlackList => AllLabelViewModel.Where(x => x.IsBlackListed);
-
- public IEnumerable<Pocket> GetUsedPockets() => AllPocket.Where(x => LabelsWhiteList.Any(y => x.Labels.Contains(y.Value)));
-
- public void Reset(Pocket[] pockets)
- {
- AllPocket = pockets;
-
- var allLabels = SmartLabel.Merge(AllPocket.Select(x => x.Labels));
- AllLabelViewModel = allLabels.Select(x => new LabelViewModel(this, x)).ToArray();
-
- OnSelectionChanged();
- }
-
- public LabelViewModel[] GetAssociatedLabels(LabelViewModel labelViewModel)
- {
- if (labelViewModel.IsBlackListed)
- {
- var associatedPockets = AllPocket.Where(x => x.Labels.Contains(labelViewModel.Value)).OrderBy(x => x.Labels.Count());
- var smallestAssociatedPocket = associatedPockets.First();
- var allAssociatedLabels = smallestAssociatedPocket.Labels;
- var affectedLabelViewModels = AllLabelViewModel.Where(x => x.IsBlackListed == labelViewModel.IsBlackListed && allAssociatedLabels.Contains(x.Value));
- return affectedLabelViewModels.ToArray();
- }
- else
- {
- var associatedPockets = AllPocket.Where(x => x.Labels.Contains(labelViewModel.Value));
- var notAssociatedPockets = AllPocket.Except(associatedPockets);
- var allNotAssociatedLabels = SmartLabel.Merge(notAssociatedPockets.Select(x => x.Labels));
- var affectedLabelViewModels = AllLabelViewModel.Where(x => x.IsBlackListed == labelViewModel.IsBlackListed && !allNotAssociatedLabels.Contains(x.Value));
- return affectedLabelViewModels.ToArray();
- }
- }
-
- public void OnPointerOver(LabelViewModel labelViewModel, bool isPointerOver)
- {
- if (!isPointerOver)
- {
- foreach (LabelViewModel lvm in AllLabelViewModel)
- {
- lvm.IsHighlighted = false;
- }
-
- return;
- }
-
- var affectedLabelViewModels = GetAssociatedLabels(labelViewModel);
-
- foreach (var lvm in affectedLabelViewModels)
- {
- lvm.IsHighlighted = isPointerOver;
- }
- }
-
- internal void SwapLabel(LabelViewModel labelViewModel)
- {
- var affectedLabelViewModels = GetAssociatedLabels(labelViewModel);
-
- foreach (var lvm in affectedLabelViewModels)
- {
- lvm.IsBlackListed = !lvm.IsBlackListed;
- }
-
- OnSelectionChanged();
- }
-
- private void OnSelectionChanged()
- {
- var sumOfWhiteList = AllPocket.Where(x => LabelsWhiteList.Any(y => x.Labels.Contains(y.Value))).Sum(x => x.Amount);
-
- foreach (var labelViewModel in LabelsWhiteList)
- {
- var sumOfLabelsPockets = AllPocket.Where(x => x.Labels.Contains(labelViewModel.Value)).Sum(x => x.Amount);
-
- labelViewModel.MustHave = sumOfWhiteList - sumOfLabelsPockets < _targetAmount;
- }
-
- this.RaisePropertyChanged(nameof(LabelsWhiteList));
- this.RaisePropertyChanged(nameof(LabelsBlackList));
- }
-}
-
-public partial class LabelViewModel : ViewModelBase
-{
- [AutoNotify] private bool _isBlackListed;
- [AutoNotify] private bool _isPointerOver;
- [AutoNotify] private bool _isHighlighted;
- [AutoNotify] private bool _mustHave;
-
- public LabelViewModel(LabelSelectionViewModel owner, string label)
- {
- Value = label;
-
- this.WhenAnyValue(x => x.IsPointerOver)
- .Skip(1)
- .Subscribe(isPointerOver => owner.OnPointerOver(this, isPointerOver));
-
- ClickedCommand = ReactiveCommand.Create(() => owner.SwapLabel(this),
- this.WhenAnyValue(x => x.MustHave, x => x.IsBlackListed).Select(x => x.Item2 || !x.Item1 && !x.Item2));
- }
-
- public string Value { get; }
-
- public ICommand ClickedCommand { get; }
-}
-
[NavigationMetaData(Title = "Privacy Control")]
public partial class PrivacyControlViewModel : DialogViewModelBase<IEnumerable<SmartCoin>>
{
@@ -142,7 +18,6 @@ public partial class PrivacyControlViewModel : DialogViewModelBase<IEnumerable<S
private readonly TransactionInfo _transactionInfo;
private readonly bool _isSilent;
-
public PrivacyControlViewModel(Wallet wallet, TransactionInfo transactionInfo, bool isSilent)
{
_wallet = wallet;

classes to separate file