fix issue

This commit is contained in:
2022-03-15 20:12:40 +08:00
parent 5b209cc19c
commit 8ba6f4bf85
8 changed files with 70 additions and 13 deletions

View File

@ -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);