language version degraded to 9.0

This commit is contained in:
2022-02-25 13:38:42 +08:00
parent 9a6011c3d8
commit e012110b00
32 changed files with 1287 additions and 1262 deletions

View File

@ -3,84 +3,85 @@ using Billing.UI;
using System;
using Xamarin.Forms;
namespace Billing.Views;
public partial class AddAccountPage : BillingPage
namespace Billing.Views
{
private static readonly BindableProperty AccountNameProperty = BindableProperty.Create(nameof(AccountName), typeof(string), typeof(AddAccountPage));
private static readonly BindableProperty AccountIconProperty = BindableProperty.Create(nameof(AccountIcon), typeof(string), typeof(AddAccountPage));
private static readonly BindableProperty CategoryProperty = BindableProperty.Create(nameof(Category), typeof(string), typeof(AddAccountPage));
private static readonly BindableProperty BalanceProperty = BindableProperty.Create(nameof(Balance), typeof(decimal), typeof(AddAccountPage));
private static readonly BindableProperty MemoProperty = BindableProperty.Create(nameof(Memo), typeof(string), typeof(AddAccountPage));
public partial class AddAccountPage : BillingPage
{
private static readonly BindableProperty AccountNameProperty = BindableProperty.Create(nameof(AccountName), typeof(string), typeof(AddAccountPage));
private static readonly BindableProperty AccountIconProperty = BindableProperty.Create(nameof(AccountIcon), typeof(string), typeof(AddAccountPage));
private static readonly BindableProperty CategoryProperty = BindableProperty.Create(nameof(Category), typeof(string), typeof(AddAccountPage));
private static readonly BindableProperty BalanceProperty = BindableProperty.Create(nameof(Balance), typeof(decimal), typeof(AddAccountPage));
private static readonly BindableProperty MemoProperty = BindableProperty.Create(nameof(Memo), typeof(string), typeof(AddAccountPage));
public string AccountName
{
get => (string)GetValue(AccountNameProperty);
set => SetValue(AccountNameProperty, value);
}
public string AccountIcon
{
get => (string)GetValue(AccountIconProperty);
set => SetValue(AccountIconProperty, value);
}
public string Category
{
get => (string)GetValue(CategoryProperty);
set => SetValue(CategoryProperty, value);
}
public decimal Balance
{
get => (decimal)GetValue(BalanceProperty);
set => SetValue(BalanceProperty, value);
}
public string Memo
{
get => (string)GetValue(MemoProperty);
set => SetValue(MemoProperty, value);
}
private readonly Account account;
public Command CheckAccount { get; }
public event EventHandler<AccountEventArgs> AccountChecked;
public AddAccountPage()
{
CheckAccount = new Command(OnCheckAccount);
InitializeComponent();
}
public AddAccountPage(Account account)
{
this.account = account;
AccountName = account.Name;
AccountIcon = account.Icon;
Category = account.Category.ToString();
Balance = account.Balance;
Memo = account.Memo;
CheckAccount = new Command(OnCheckAccount);
InitializeComponent();
}
private void OnCheckAccount()
{
AccountChecked?.Invoke(this, new AccountEventArgs
public string AccountName
{
Account = new Account
{
Id = account?.Id ?? -1,
Name = AccountName,
Icon = AccountIcon,
//Category = Category,
Balance = Balance,
Memo = Memo
}
});
}
}
get => (string)GetValue(AccountNameProperty);
set => SetValue(AccountNameProperty, value);
}
public string AccountIcon
{
get => (string)GetValue(AccountIconProperty);
set => SetValue(AccountIconProperty, value);
}
public string Category
{
get => (string)GetValue(CategoryProperty);
set => SetValue(CategoryProperty, value);
}
public decimal Balance
{
get => (decimal)GetValue(BalanceProperty);
set => SetValue(BalanceProperty, value);
}
public string Memo
{
get => (string)GetValue(MemoProperty);
set => SetValue(MemoProperty, value);
}
public class AccountEventArgs : EventArgs
{
public Account Account { get; set; }
}
private readonly Account account;
public Command CheckAccount { get; }
public event EventHandler<AccountEventArgs> AccountChecked;
public AddAccountPage()
{
CheckAccount = new Command(OnCheckAccount);
InitializeComponent();
}
public AddAccountPage(Account account)
{
this.account = account;
AccountName = account.Name;
AccountIcon = account.Icon;
Category = account.Category.ToString();
Balance = account.Balance;
Memo = account.Memo;
CheckAccount = new Command(OnCheckAccount);
InitializeComponent();
}
private void OnCheckAccount()
{
AccountChecked?.Invoke(this, new AccountEventArgs
{
Account = new Account
{
Id = account?.Id ?? -1,
Name = AccountName,
Icon = AccountIcon,
//Category = Category,
Balance = Balance,
Memo = Memo
}
});
}
}
public class AccountEventArgs : EventArgs
{
public Account Account { get; set; }
}
}