use new class in list
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Receive/ReceiveAddressesViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Receive/ReceiveAddressesViewModel.cs
@@ -4,6 +4,7 @@ using System.Collections.ObjectModel;
using System.Linq;
using System.Reactive.Disposables;
using System.Reactive.Linq;
+using NBitcoin;
using ReactiveUI;
using WalletWasabi.Blockchain.Keys;
using WalletWasabi.Fluent.ViewModels.Navigation;
@@ -15,13 +16,14 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Receive
[NavigationMetaData(Title = "Receive Addresses")]
public partial class ReceiveAddressesViewModel : RoutableViewModel
{
- [AutoNotify] private ObservableCollection<HdPubKey> _addresses;
+ [AutoNotify] private ObservableCollection<AddressViewModel> _addresses;
[AutoNotify] private HdPubKey? _selectedAddress;
public ReceiveAddressesViewModel(Wallet wallet)
{
Wallet = wallet;
- _addresses = new ObservableCollection<HdPubKey>();
+ Network = wallet.Network;
+ _addresses = new ObservableCollection<AddressViewModel>();
InitializeAddresses();
@@ -41,6 +43,8 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Receive
public Wallet Wallet { get; }
+ public Network Network { get; }
+
protected override void OnNavigatedTo(bool inStack, CompositeDisposable disposables)
{
base.OnNavigatedTo(inStack, disposables);
@@ -62,7 +66,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Receive
foreach (HdPubKey key in keys)
{
- Addresses.Add(key);
+ Addresses.Add(new AddressViewModel(key, Network));
}
}
catch (Exception ex)

MODIFY
WalletWasabi.Fluent/Views/Wallets/Receive/ReceiveAddressesView.axaml
WalletWasabi.Fluent/Views/Wallets/Receive/ReceiveAddressesView.axaml
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:c="using:WalletWasabi.Fluent.Controls"
xmlns:receive="clr-namespace:WalletWasabi.Fluent.ViewModels.Wallets.Receive"
- xmlns:keys="clr-namespace:WalletWasabi.Blockchain.Keys;assembly=WalletWasabi"
+ xmlns:controls="clr-namespace:WalletWasabi.Gui.Controls;assembly=WalletWasabi.Gui"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:DataType="receive:ReceiveAddressesViewModel"
x:CompileBindings="True"
CanUserSortColumns="True" >
<DataGrid.Columns>
<DataGridTextColumn Header="Header 1"
- x:DataType="keys:HdPubKey"
+ x:DataType="receive:AddressViewModel"
Binding="{Binding Label}"
Width="*"
CanUserSort="True" />
<DataGridTextColumn Header="Header 2"
- x:DataType="keys:HdPubKey"
- Binding="{Binding P2pkScript}"
+ x:DataType="receive:AddressViewModel"
+ Binding="{Binding Address}"
Width="2*"
CanUserSort="True" />
</DataGrid.Columns>

use new class in list