complete account page

This commit is contained in:
2022-03-02 17:31:49 +08:00
parent aa38e186c7
commit 51f8e4f2e8
26 changed files with 547 additions and 76 deletions

View File

@@ -1,4 +1,8 @@
using Billing.Languages;
using System.Collections.Generic;
using System.Threading.Tasks;
using Billing.Languages;
using Billing.Models;
using Billing.Store;
using Billing.Themes;
using Xamarin.Essentials;
using Xamarin.Forms;
@@ -9,6 +13,13 @@ namespace Billing
{
public static AppTheme CurrentTheme { get; private set; }
public static PlatformCulture CurrentCulture { get; private set; }
public static List<Bill> Bills => bills ??= new List<Bill>();
public static List<Account> Accounts => accounts ??= new List<Account>();
public static List<Category> Categories => categories ??= new List<Category>();
private static List<Bill> bills;
private static List<Account> accounts;
private static List<Category> categories;
public App()
{
@@ -19,8 +30,21 @@ namespace Billing
Shell.Current.GoToAsync("//Bills");
}
public static void WriteAccounts() => StoreHelper.WriteAccounts(accounts);
public static void WriteBills() => StoreHelper.WriteBills(bills);
protected override void OnStart()
{
Helper.Debug($"personal folder: {StoreHelper.PersonalFolder}");
Helper.Debug($"cache folder: {StoreHelper.CacheFolder}");
Task.Run(() =>
{
accounts = StoreHelper.GetAccounts();
categories = StoreHelper.GetCategories();
bills = StoreHelper.GetBills();
});
}
protected override void OnResume()