category selector

This commit is contained in:
gaoyuan
2022-02-28 23:05:21 +08:00
parent 589c7514f2
commit 5b954ac441
28 changed files with 81 additions and 32 deletions

View File

@ -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