tiny fix
This commit is contained in:
parent
46464e19dc
commit
9f783c1b5f
@ -60,7 +60,7 @@ namespace Billing.Views
|
||||
{
|
||||
cat = TopCategories.SelectMany(g => g).FirstOrDefault(c => c.Category.Id == category.ParentId);
|
||||
}
|
||||
OnTopCategoryTapped(cat);
|
||||
DoRefreshSubCategories(cat);
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
@ -76,6 +76,16 @@ namespace Billing.Views
|
||||
};
|
||||
}
|
||||
|
||||
private void DoRefreshSubCategories(UICategory category)
|
||||
{
|
||||
var many = TopCategories.SelectMany(g => g);
|
||||
foreach (var m in many)
|
||||
{
|
||||
m.IsChecked = m == category;
|
||||
}
|
||||
SubCategories = App.Categories.Where(c => c.ParentId == category.Category.Id).Select(c => WrapCategory(c)).ToList();
|
||||
}
|
||||
|
||||
private async void OnTopCategoryTapped(object o)
|
||||
{
|
||||
if (Tap.IsBusy)
|
||||
@ -86,12 +96,7 @@ namespace Billing.Views
|
||||
{
|
||||
if (o is UICategory category)
|
||||
{
|
||||
var many = TopCategories.SelectMany(g => g);
|
||||
foreach (var m in many)
|
||||
{
|
||||
m.IsChecked = m == category;
|
||||
}
|
||||
SubCategories = App.Categories.Where(c => c.ParentId == category.Category.Id).Select(c => WrapCategory(c)).ToList();
|
||||
DoRefreshSubCategories(category);
|
||||
if (SubCategories.Count == 0)
|
||||
{
|
||||
CategoryTapped?.Invoke(this, category);
|
||||
|
Loading…
x
Reference in New Issue
Block a user