diff --git a/Atomex.Client.Wpf.Installer/Product.wxs b/Atomex.Client.Wpf.Installer/Product.wxs index cfcaf87..eb3dc5e 100644 --- a/Atomex.Client.Wpf.Installer/Product.wxs +++ b/Atomex.Client.Wpf.Installer/Product.wxs @@ -3,7 +3,7 @@ - + diff --git a/Atomex.Client.Wpf/ViewModels/SendViewModels/DelegateViewModel.cs b/Atomex.Client.Wpf/ViewModels/SendViewModels/DelegateViewModel.cs index 8517363..6ebeb2c 100644 --- a/Atomex.Client.Wpf/ViewModels/SendViewModels/DelegateViewModel.cs +++ b/Atomex.Client.Wpf/ViewModels/SendViewModels/DelegateViewModel.cs @@ -22,6 +22,17 @@ namespace Atomex.Client.Wpf.ViewModels.SendViewModels { + public class WalletAddressViewModel + { + public WalletAddress WalletAddress { get; set; } + + public string Address => WalletAddress.Address; + public decimal AvailableBalance => WalletAddress.AvailableBalance(); + + public WalletAddressViewModel(WalletAddress walletAddress) => + WalletAddress = walletAddress; + } + public class DelegateViewModel : BaseViewModel { private IAtomexApp App { get; } @@ -54,8 +65,8 @@ private set } } - private List _fromAddressList; - public List FromAddressList + private List _fromAddressList; + public List FromAddressList { get => _fromAddressList; private set @@ -63,7 +74,7 @@ private set _fromAddressList = value; OnPropertyChanged(nameof(FromAddressList)); - WalletAddress = FromAddressList.FirstOrDefault(); + WalletAddress = FromAddressList.FirstOrDefault().WalletAddress; } } @@ -295,6 +306,7 @@ private async Task PrepareWallet(CancellationToken cancellationToken = default) FromAddressList = (await App.Account .GetUnspentAddressesAsync(_tezos, cancellationToken).ConfigureAwait(false)) .OrderByDescending(x => x.Balance) + .Select(w => new WalletAddressViewModel(w)) .ToList(); if (!FromAddressList?.Any() ?? false) @@ -303,7 +315,7 @@ private async Task PrepareWallet(CancellationToken cancellationToken = default) return; } - WalletAddress = FromAddressList.FirstOrDefault(); + WalletAddress = FromAddressList.FirstOrDefault().WalletAddress; } private async Task> SendDelegation(CancellationToken cancellationToken = default) diff --git a/Atomex.Client.Wpf/Views/SendViews/DelegatePage.xaml b/Atomex.Client.Wpf/Views/SendViews/DelegatePage.xaml index 7c37061..8d2afbb 100644 --- a/Atomex.Client.Wpf/Views/SendViews/DelegatePage.xaml +++ b/Atomex.Client.Wpf/Views/SendViews/DelegatePage.xaml @@ -14,15 +14,16 @@ UseLayoutRounding="True" Focusable="False" d:DesignHeight="500" - d:DesignWidth="560" + d:DesignWidth="600" d:DataContext="{d:DesignInstance Type=viewModels:DelegateViewModel, IsDesignTimeCreatable=True}"> + + Width="600"> - - @@ -85,16 +87,38 @@ VerticalAlignment="Center" HorizontalAlignment="Right"/> - + Style="{StaticResource CustomComboBox}"> + + + + + + + + + -