Donations are sorted ascending

This commit is contained in:
BONNEVILLE Geoffroy
2017-12-11 11:08:33 +01:00
parent 35f64eec1b
commit 50c5940a0a
2 changed files with 10 additions and 2 deletions

View File

@@ -26,8 +26,16 @@ namespace ModernKeePass.ViewModels
public DonateVm(ILicenseService license)
{
var usNfi = new NumberFormatInfo
{
NegativeSign = "-",
NumberDecimalSeparator = ".",
NumberGroupSeparator = ",",
CurrencySymbol = "$"
};
_license = license;
Donations = new ObservableCollection<ProductListing>(_license.Products.Values.OrderBy(p => /*decimal.Parse(*/p.FormattedPrice/*, NumberStyles.Currency | NumberStyles.AllowDecimalPoint)*/));
Donations = new ObservableCollection<ProductListing>(
_license.Products.Values.OrderBy(p => decimal.Parse(p.FormattedPrice, NumberStyles.Currency, usNfi)));
}
public async Task<int> Purchase()

View File

@@ -16,7 +16,7 @@
x:Name="DonateItemsSource"
Source="{Binding Donations}" />
</Page.Resources>
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Margin="10,0,0,0">
<TextBlock x:Uid="DonateDesc" Style="{StaticResource BodyTextBlockStyle}" />
<ItemsControl ItemsSource="{Binding Source={StaticResource DonateItemsSource}}" Margin="0,10,0,10">
<ItemsControl.ItemTemplate>