Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7510 from wieslawsoltes/vdg/ExpandCoinjoinsTreeDa…
…taGrid [VDG] [Fluent] Allow Coinjoins to be expanded in the TreeDataGrid
- Loading branch information
Showing
5 changed files
with
145 additions
and
5 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
...asabi.Fluent/ViewModels/Wallets/Home/History/HistoryItems/CoinJoinHistoryItemViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reactive; | ||
using NBitcoin; | ||
using ReactiveUI; | ||
using WalletWasabi.Blockchain.Transactions; | ||
using WalletWasabi.Fluent.Extensions; | ||
using WalletWasabi.Fluent.ViewModels.Navigation; | ||
|
||
namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.History.HistoryItems; | ||
|
||
public class CoinJoinHistoryItemViewModel : HistoryItemViewModelBase | ||
{ | ||
public CoinJoinHistoryItemViewModel( | ||
int orderIndex, | ||
TransactionSummary transactionSummary, | ||
WalletViewModel walletViewModel, | ||
Money balance, | ||
IObservable<Unit> updateTrigger) | ||
: base(orderIndex, transactionSummary) | ||
{ | ||
Label = transactionSummary.Label.Take(1).FirstOrDefault(); | ||
FilteredLabel = transactionSummary.Label.Skip(1).ToList(); | ||
IsConfirmed = transactionSummary.IsConfirmed(); | ||
Date = transactionSummary.DateTime.ToLocalTime(); | ||
Balance = balance; | ||
IsCoinJoin = true; | ||
|
||
var amount = transactionSummary.Amount; | ||
if (amount < Money.Zero) | ||
{ | ||
OutgoingAmount = amount * -1; | ||
} | ||
else | ||
{ | ||
IncomingAmount = amount; | ||
} | ||
|
||
ShowDetailsCommand = ReactiveCommand.Create(() => | ||
RoutableViewModel.Navigate(NavigationTarget.DialogScreen).To( | ||
new TransactionDetailsViewModel(transactionSummary, walletViewModel.Wallet, updateTrigger))); | ||
|
||
DateString = $"{Date.ToLocalTime():MM/dd/yy HH:mm}"; | ||
} | ||
|
||
public bool IsCoinJoinTransaction => true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters