mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Donations are sorted ascending
This commit is contained in:
@@ -26,8 +26,16 @@ namespace ModernKeePass.ViewModels
|
|||||||
|
|
||||||
public DonateVm(ILicenseService license)
|
public DonateVm(ILicenseService license)
|
||||||
{
|
{
|
||||||
|
var usNfi = new NumberFormatInfo
|
||||||
|
{
|
||||||
|
NegativeSign = "-",
|
||||||
|
NumberDecimalSeparator = ".",
|
||||||
|
NumberGroupSeparator = ",",
|
||||||
|
CurrencySymbol = "$"
|
||||||
|
};
|
||||||
_license = license;
|
_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()
|
public async Task<int> Purchase()
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
x:Name="DonateItemsSource"
|
x:Name="DonateItemsSource"
|
||||||
Source="{Binding Donations}" />
|
Source="{Binding Donations}" />
|
||||||
</Page.Resources>
|
</Page.Resources>
|
||||||
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Margin="10,0,0,0">
|
||||||
<TextBlock x:Uid="DonateDesc" Style="{StaticResource BodyTextBlockStyle}" />
|
<TextBlock x:Uid="DonateDesc" Style="{StaticResource BodyTextBlockStyle}" />
|
||||||
<ItemsControl ItemsSource="{Binding Source={StaticResource DonateItemsSource}}" Margin="0,10,0,10">
|
<ItemsControl ItemsSource="{Binding Source={StaticResource DonateItemsSource}}" Margin="0,10,0,10">
|
||||||
<ItemsControl.ItemTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
|
Reference in New Issue
Block a user