fix issue
This commit is contained in:
@ -50,6 +50,17 @@ namespace Billing.Views
|
||||
groupLayout.Refresh(accounts);
|
||||
}
|
||||
|
||||
protected override void OnRefresh()
|
||||
{
|
||||
accounts.Clear();
|
||||
foreach (var account in App.Accounts)
|
||||
{
|
||||
AddToAccountGroup(account);
|
||||
}
|
||||
RefreshBalance(true);
|
||||
groupLayout.Refresh(accounts);
|
||||
}
|
||||
|
||||
private void RefreshBalance(bool calc = false)
|
||||
{
|
||||
if (calc)
|
||||
|
@ -60,19 +60,23 @@ namespace Billing.Views
|
||||
billingDate.SetDateTime(DateTime.Today);
|
||||
}
|
||||
|
||||
private void OnDateSelected(object sender, DateEventArgs e)
|
||||
protected override void OnRefresh()
|
||||
{
|
||||
SelectedDate = e.Date;
|
||||
|
||||
Task.Run(() =>
|
||||
{
|
||||
var bills = App.Bills.Where(b => Helper.IsSameDay(b.CreateTime, e.Date));
|
||||
var bills = App.Bills.Where(b => Helper.IsSameDay(b.CreateTime, SelectedDate));
|
||||
Bills = new List<UIBill>(bills.OrderBy(b => b.CreateTime).Select(b => Helper.WrapBill(b)));
|
||||
RefreshBalance(Bills);
|
||||
MainThread.BeginInvokeOnMainThread(async () => await scrollView.ScrollToAsync(0, 0, true));
|
||||
});
|
||||
}
|
||||
|
||||
private void OnDateSelected(object sender, DateEventArgs e)
|
||||
{
|
||||
SelectedDate = e.Date;
|
||||
OnRefresh();
|
||||
}
|
||||
|
||||
private void RefreshBalance(List<UIBill> bills)
|
||||
{
|
||||
SetValue(NoBillsProperty, bills.Count == 0);
|
||||
|
@ -229,6 +229,11 @@ namespace Billing.Views
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnRefresh()
|
||||
{
|
||||
OnDateChanged(this);
|
||||
}
|
||||
|
||||
private void OnDateTypeCommand(DateType index)
|
||||
{
|
||||
if (index < DateType.Monthly || index > DateType.Total)
|
||||
|
@ -59,6 +59,12 @@ namespace Billing.Views
|
||||
//Light.Instance.RefreshColor(Color.FromHex(color));
|
||||
}
|
||||
|
||||
protected override async void OnRefresh()
|
||||
{
|
||||
var count = await StoreHelper.GetLogsCount();
|
||||
SetValue(ManyRecordsProperty, string.Format(Resource.ManyRecords, count));
|
||||
}
|
||||
|
||||
private async void OnShareCommand()
|
||||
{
|
||||
if (Tap.IsBusy)
|
||||
|
Reference in New Issue
Block a user