ui fix
This commit is contained in:
@ -12,11 +12,9 @@ namespace Billing.Views
|
||||
{
|
||||
public partial class BillPage : BillingPage
|
||||
{
|
||||
private static readonly DateTime dateNow = DateTime.Today;
|
||||
|
||||
private static readonly BindableProperty SelectedDateProperty = Helper.Create<DateTime, BillPage>(nameof(SelectedDate), defaultValue: dateNow, propertyChanged: OnSelectedDateChanged);
|
||||
private static readonly BindableProperty SelectedDateProperty = Helper.Create<DateTime, BillPage>(nameof(SelectedDate), propertyChanged: OnSelectedDateChanged);
|
||||
private static readonly BindableProperty BillsProperty = Helper.Create<List<UIBill>, BillPage>(nameof(Bills));
|
||||
private static readonly BindableProperty NoBillsProperty = Helper.Create<bool, BillPage>(nameof(NoBills));
|
||||
private static readonly BindableProperty NoBillsProperty = Helper.Create<bool, BillPage>(nameof(NoBills), defaultValue: true);
|
||||
private static readonly BindableProperty IncomeProperty = Helper.Create<decimal, BillPage>(nameof(Income));
|
||||
private static readonly BindableProperty SpendingProperty = Helper.Create<decimal, BillPage>(nameof(Spending));
|
||||
private static readonly BindableProperty BalanceProperty = Helper.Create<decimal, BillPage>(nameof(Balance));
|
||||
@ -46,6 +44,8 @@ namespace Billing.Views
|
||||
public Command EditBilling { get; }
|
||||
public Command DeleteBilling { get; }
|
||||
|
||||
private bool initialized;
|
||||
|
||||
public BillPage()
|
||||
{
|
||||
TitleDateTap = new Command(OnTitleDateTapped);
|
||||
@ -54,8 +54,15 @@ namespace Billing.Views
|
||||
DeleteBilling = new Command(OnDeleteBilling);
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
billingDate.SetDateTime(dateNow);
|
||||
public override void OnLoaded()
|
||||
{
|
||||
if (!initialized)
|
||||
{
|
||||
initialized = true;
|
||||
billingDate.SetDateTime(DateTime.Today);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDateSelected(object sender, DateEventArgs e)
|
||||
@ -109,7 +116,10 @@ namespace Billing.Views
|
||||
|
||||
private void TitlePicker_DateSelected(object sender, DateChangedEventArgs e)
|
||||
{
|
||||
billingDate.SetDateTime(e.NewDate);
|
||||
if (e.NewDate.Year > 1900)
|
||||
{
|
||||
billingDate.SetDateTime(e.NewDate);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTitleDateLongPressed()
|
||||
|
Reference in New Issue
Block a user