Example #1
0
        private void Filter(string query, Func <Model.Prestart, string> prop)
        {
            var filteredList = Items.Where(i => prop(i).ToLower().Contains(query.ToLower())).ToList();

            FilteredPrestarts.Clear();
            foreach (var item in filteredList)
            {
                FilteredPrestarts.Add(item);
            }
        }
Example #2
0
        async Task ExecuteRefreshCommand()
        {
            if (IsBusy)
            {
                return;
            }
            IsBusy = true;

            try
            {
                await App.CloudService.SyncOfflineCacheAsync();

                var table = await App.CloudService.GetTableAsync <Model.Prestart>();

                var list = await table.ReadItemsAfterDateAsync(DateTime.Now.StartOfWeek(DayOfWeek.Monday));

                ShowError = list.Count == 0;
                Items.Clear();
                foreach (var item in list)
                {
                    Items.Add(item);
                }
                foreach (var item in Items)
                {
                    FilteredPrestarts.Add(item);
                }
                ;
            }
            catch (Exception ex)
            {
                Debug.WriteLine($"[TaskList] Error loading items: {ex.Message}");
            }
            finally
            {
                IsBusy = false;
            }
        }