Group all column generators
MODIFY
WalletWasabi.Fluent/ViewModels/CoinControl/CoinSelectorViewModel.cs
WalletWasabi.Fluent/ViewModels/CoinControl/CoinSelectorViewModel.cs
@@ -86,6 +86,68 @@ public class CoinSelectorViewModel : ViewModelBase, IDisposable
.ToList();
}
+ private static void SyncSelectedItems(IEnumerable<PocketCoinControlItemViewModel> items, IEnumerable<SmartCoin> selectedCoins)
+ {
+ var allCoins = GetAllCoinItems(items);
+ var selected = allCoins.Where(x => selectedCoins.Any(other => other == x.SmartCoin));
+ foreach (var viewModel in selected)
+ {
+ viewModel.IsSelected = true;
+ }
+ }
+
+ private static int GetLabelPriority(CoinControlItemViewModelBase coin)
+ {
+ if (coin.Labels == CoinPocketHelper.PrivateFundsText)
+ {
+ return 3;
+ }
+
+ if (coin.Labels == CoinPocketHelper.SemiPrivateFundsText)
+ {
+ return 2;
+ }
+
+ return 1;
+ }
+
+ private static int GetIndicatorPriority(CoinControlItemViewModelBase x)
+ {
+ if (x.IsCoinjoining)
+ {
+ return 1;
+ }
+
+ if (x.BannedUntilUtc.HasValue)
+ {
+ return 2;
+ }
+
+ if (!x.IsConfirmed)
+ {
+ return 3;
+ }
+
+ return 0;
+ }
+
+ private static IReadOnlyCollection<PocketCoinControlItemViewModel> CreatePocketItems(IEnumerable<Pocket> pockets)
+ {
+ return pockets
+ .Select(pocket => new PocketCoinControlItemViewModel(pocket))
+ .ToList();
+ }
+
+ private static Comparison<TSource?> SortAscending<TSource, TProperty>(Func<TSource, TProperty> selector)
+ {
+ return (x, y) => Comparer<TProperty>.Default.Compare(selector(x!), selector(y!));
+ }
+
+ private static Comparison<TSource?> SortDescending<TSource, TProperty>(Func<TSource, TProperty> selector)
+ {
+ return (x, y) => Comparer<TProperty>.Default.Compare(selector(y!), selector(x!));
+ }
+
private static IColumn<CoinControlItemViewModelBase> ChildrenColumn()
{
return new HierarchicalExpanderColumn<CoinControlItemViewModelBase>(
@@ -105,16 +167,6 @@ public class CoinSelectorViewModel : ViewModelBase, IDisposable
GridLength.Auto);
}
- private static void SyncSelectedItems(IEnumerable<PocketCoinControlItemViewModel> items, IEnumerable<SmartCoin> selectedCoins)
- {
- var allCoins = GetAllCoinItems(items);
- var selected = allCoins.Where(x => selectedCoins.Any(other => other == x.SmartCoin));
- foreach (var viewModel in selected)
- {
- viewModel.IsSelected = true;
- }
- }
-
private static IColumn<CoinControlItemViewModelBase> AmountColumn()
{
return new PlainTextColumn<CoinControlItemViewModelBase>(
@@ -166,56 +218,4 @@ public class CoinSelectorViewModel : ViewModelBase, IDisposable
CompareDescending = SortDescending<CoinControlItemViewModelBase, int>(GetLabelPriority)
});
}
-
- private static int GetLabelPriority(CoinControlItemViewModelBase coin)
- {
- if (coin.Labels == CoinPocketHelper.PrivateFundsText)
- {
- return 3;
- }
-
- if (coin.Labels == CoinPocketHelper.SemiPrivateFundsText)
- {
- return 2;
- }
-
- return 1;
- }
-
- private static int GetIndicatorPriority(CoinControlItemViewModelBase x)
- {
- if (x.IsCoinjoining)
- {
- return 1;
- }
-
- if (x.BannedUntilUtc.HasValue)
- {
- return 2;
- }
-
- if (!x.IsConfirmed)
- {
- return 3;
- }
-
- return 0;
- }
-
- private static IReadOnlyCollection<PocketCoinControlItemViewModel> CreatePocketItems(IEnumerable<Pocket> pockets)
- {
- return pockets
- .Select(pocket => new PocketCoinControlItemViewModel(pocket))
- .ToList();
- }
-
- private static Comparison<TSource?> SortAscending<TSource, TProperty>(Func<TSource, TProperty> selector)
- {
- return (x, y) => Comparer<TProperty>.Default.Compare(selector(x!), selector(y!));
- }
-
- private static Comparison<TSource?> SortDescending<TSource, TProperty>(Func<TSource, TProperty> selector)
- {
- return (x, y) => Comparer<TProperty>.Default.Compare(selector(y!), selector(x!));
- }
}

Group all column generators