category selector
This commit is contained in:
@ -54,7 +54,7 @@
|
||||
</ui:GroupStackLayout.GroupHeaderTemplate>
|
||||
<ui:GroupStackLayout.ItemTemplate>
|
||||
<DataTemplate x:DataType="m:Account">
|
||||
<StackLayout Orientation="Horizontal" Padding="20, 0" HeightRequest="44" Spacing="10">
|
||||
<StackLayout Orientation="Horizontal" Padding="20, 0, 10, 0" HeightRequest="44" Spacing="10">
|
||||
<Image Source="{Binding Icon}" HeightRequest="20" VerticalOptions="Center"/>
|
||||
<Label Text="{Binding Name}" TextColor="{DynamicResource TextColor}"
|
||||
HorizontalOptions="FillAndExpand" VerticalOptions="Center"
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using Billing.Models;
|
||||
using Billing.UI;
|
||||
|
@ -108,15 +108,24 @@ namespace Billing.Views
|
||||
}
|
||||
using (Tap.Start())
|
||||
{
|
||||
await Navigation.PushAsync(new ItemSelectPage(new List<SelectItem<AccountCategory>>
|
||||
var source = new List<SelectItem<AccountCategory>>
|
||||
{
|
||||
new() { Icon = "sackdollar", Value = AccountCategory.Cash, Name = Resource.Cash },
|
||||
new() { Icon = "creditcard", Value = AccountCategory.CreditCard, Name = Resource.CreditCard },
|
||||
new() { Icon = "", Value = AccountCategory.DebitCard, Name = Resource.DebitCard },
|
||||
new() { Icon = "", Value = AccountCategory.ElecAccount, Name = Resource.ElecAccount }
|
||||
}));
|
||||
new() { Icon = "debitcard", Value = AccountCategory.DebitCard, Name = Resource.DebitCard },
|
||||
new() { Icon = "coins", Value = AccountCategory.ElecAccount, Name = Resource.ElecAccount }
|
||||
};
|
||||
var page = new ItemSelectPage<SelectItem<AccountCategory>>(source);
|
||||
page.ItemTapped += Category_ItemTapped;
|
||||
await Navigation.PushAsync(page);
|
||||
}
|
||||
}
|
||||
|
||||
private async void Category_ItemTapped(object sender, SelectItem<AccountCategory> e)
|
||||
{
|
||||
Category = e.Value;
|
||||
await Navigation.PopAsync();
|
||||
}
|
||||
}
|
||||
|
||||
public class AccountEventArgs : EventArgs
|
||||
|
Reference in New Issue
Block a user