Add HasChildren method to history item
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryItems/CoinJoinsHistoryItemViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryItems/CoinJoinsHistoryItemViewModel.cs
@@ -65,6 +65,16 @@ public class CoinJoinsHistoryItemViewModel : HistoryItemViewModelBase
return result;
}
+ public override bool HasChildren()
+ {
+ if (CoinJoinTransactions.Count > 1)
+ {
+ return true;
+ }
+
+ return false;
+ }
+
public void Add(TransactionSummary item)
{
if (!item.IsOwnCoinjoin)

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryItems/HistoryItemViewModelBase.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryItems/HistoryItemViewModelBase.cs
@@ -71,8 +71,20 @@ public abstract partial class HistoryItemViewModelBase : ViewModelBase
protected virtual ObservableCollection<HistoryItemViewModelBase> LoadChildren()
{
throw new NotSupportedException();
+ static bool HasChildren(HistoryItemViewModelBase item)
+ {
+ if (item is CoinJoinsHistoryItemViewModel coinJoinsHistoryItemViewModel
+ && coinJoinsHistoryItemViewModel.CoinJoinTransactions.Count > 1)
+ {
+ return true;
+ }
+
+ return false;
+ }
}
+ public virtual bool HasChildren() => false;
+
public static Comparison<HistoryItemViewModelBase?> SortAscending<T>(Func<HistoryItemViewModelBase, T> selector)
{
return (x, y) =>

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryViewModel.cs
@@ -86,16 +86,7 @@ public partial class HistoryViewModel : ActivatableViewModel
},
width: new GridLength(0, GridUnitType.Auto)),
x => x.Children,
- x =>
- {
- if (x is CoinJoinsHistoryItemViewModel coinJoinsHistoryItemViewModel
- && coinJoinsHistoryItemViewModel.CoinJoinTransactions.Count > 1)
- {
- return true;
- }
-
- return false;
- },
+ x => x.HasChildren(),
x => x.IsExpanded),
// Date

Add HasChildren method to history item