Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Commit

Permalink
update client to v1.0.16
Browse files Browse the repository at this point in the history
  • Loading branch information
matsakiv committed Dec 9, 2019
1 parent 2eb2b18 commit 430dbc6
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Atomex.Client.Wpf.Installer/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<?define Name = "Atomex Client" ?>
<?define Manufacturer = "Atomex.me" ?>
<?define Description = "Multicurrency HD wallet with built-in hybrid exchange based on atomic swap." ?>
<?define Version = "1.0.15" ?>
<?define Version = "1.0.16" ?>
<?define UpgradeCode = "DB7FCF8D-E0C6-4C99-A6B1-3FB6D703F97E" ?>
<?define ExeName = "Atomex.Client.Wpf.exe" ?>

Expand Down
20 changes: 16 additions & 4 deletions Atomex.Client.Wpf/ViewModels/SendViewModels/DelegateViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -54,16 +65,16 @@ private set
}
}

private List<WalletAddress> _fromAddressList;
public List<WalletAddress> FromAddressList
private List<WalletAddressViewModel> _fromAddressList;
public List<WalletAddressViewModel> FromAddressList
{
get => _fromAddressList;
private set
{
_fromAddressList = value;
OnPropertyChanged(nameof(FromAddressList));

WalletAddress = FromAddressList.FirstOrDefault();
WalletAddress = FromAddressList.FirstOrDefault().WalletAddress;
}
}

Expand Down Expand Up @@ -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)
Expand All @@ -303,7 +315,7 @@ private async Task PrepareWallet(CancellationToken cancellationToken = default)
return;
}

WalletAddress = FromAddressList.FirstOrDefault();
WalletAddress = FromAddressList.FirstOrDefault().WalletAddress;
}

private async Task<Result<string>> SendDelegation(CancellationToken cancellationToken = default)
Expand Down
40 changes: 32 additions & 8 deletions Atomex.Client.Wpf/Views/SendViews/DelegatePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}">
<Page.Resources>
<SolidColorBrush x:Key="AmountBrush" Color="#ffa500"/>
<converters:InverseBooleanConverter x:Key="InverseBooleanConverter" />
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" FalseEquivalent="Collapsed" />
</Page.Resources>

<StackPanel Orientation="Vertical"
Width="560">
Width="600">

<Border Margin="0 10 0 10"
Height="33"
Expand All @@ -45,7 +46,7 @@
TextWrapping="Wrap"
HorizontalAlignment="Center"/>

<ComboBox Width="480"
<ComboBox Width="510"
MinHeight="68"
Margin="0 5 0 5"
ItemsSource="{Binding FromBakersList}"
Expand All @@ -64,13 +65,14 @@
VerticalAlignment="Center"
HorizontalAlignment="Right"/>
</Border>
<TextBox Width="380"
<TextBox Width="410"
Height="40"
Margin="0 5 0 5"
Text="{Binding Address, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Background="{StaticResource DefaultSubstrateBrush}"
Foreground="{StaticResource DefaultForegroundBrush}"
helpers:TextBoxHelper.CornerRadius="0 20 20 0"
FontFamily="Roboto"
Style="{StaticResource CustomTextBox}"/>
</StackPanel>

Expand All @@ -85,16 +87,38 @@
VerticalAlignment="Center"
HorizontalAlignment="Right"/>
</Border>
<ComboBox Width="380"
<ComboBox Width="410"
Height="40"
Margin="0 5 0 5"
ItemsSource="{Binding FromAddressList}"
DisplayMemberPath="Address"
SelectedValuePath="WalletAddress"
SelectedValue="{Binding WalletAddress, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
Background="{StaticResource DefaultSubstrateBrush}"
Foreground="{StaticResource DefaultForegroundBrush}"
helpers:ComboBoxHelper.CornerRadius="0 20 20 0"
Style="{StaticResource CustomComboBox}"/>
Style="{StaticResource CustomComboBox}">
<ComboBox.ItemTemplate>
<DataTemplate DataType="{x:Type ComboBoxItem}">
<StackPanel Orientation="Horizontal">
<TextBlock
Margin="3 0 0 0"
Text="{Binding Address}"
Foreground="{StaticResource DefaultForegroundBrush}"
FontSize="12"
FontFamily="{StaticResource Roboto}"
HorizontalAlignment="Left"
VerticalAlignment="Center"/>
<TextBlock
Margin="10 0 0 0"
Text="{Binding AvailableBalance, StringFormat=0.000000}"
Foreground="{StaticResource AmountBrush}"
FontSize="12"
FontFamily="{StaticResource Roboto}"
VerticalAlignment="Center"/>
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</StackPanel>

<StackPanel Orientation="Horizontal"
Expand All @@ -114,7 +138,7 @@
HorizontalAlignment="Right"/>
</Border>

<TextBox Width="380"
<TextBox Width="410"
Height="40"
Margin="0 5 0 5"
FontSize="18"
Expand Down

0 comments on commit 430dbc6

Please sign in to comment.