async Task ExecuteLoadItemsCommand() { if (IsBusy) { return; } IsBusy = true; try { ItemsTodo.Clear(); TimeLine = new DateTime(); TimeLine = TimeLine.AddDays((WeekTimeLine * 7) - 1); var items = await ItemTodoDataStore.GetItemsTodoAsync(TimeLine, true); foreach (var item in items) { ItemsTodo.Add(item); } } catch (Exception ex) { Debug.WriteLine(ex); } finally { IsBusy = false; } }
async Task ExecutePrevItemsCommand(int weektosearch) { if (IsBusy) { return; } IsBusy = true; try { ItemsTodo.Clear(); TimeLine = new DateTime(); if (WeekTimeLine <= 1) { WeekTimeLine = 2; } TimeLine = TimeLine.AddDays(((WeekTimeLine - 1) * 7)); var items = await ItemTodoDataStore.GetItemsTodoAsync(TimeLine, true); foreach (var item in items) { ItemsTodo.Add(item); } if (WeekTimeLine <= 1) { WeekTimeLine = 2; } else { WeekTimeLine = WeekTimeLine - 1; } } catch (Exception ex) { Debug.WriteLine(ex); } finally { IsBusy = false; } }