public void LoadDatabySort() { if (HIOStaticValues.CheckSyncingData()) { return; } #region Sort Data List <TAccountItem> items = SourceItems.ToList(); SourceItems.Clear(); if (SortByField.IsNullOrEmpty() || "Name".Equals(SortByField, StringComparison.InvariantCultureIgnoreCase)) { items = items.OrderBy(t => t.Name).ToList(); } else if ("Date".Equals(SortByField, StringComparison.InvariantCultureIgnoreCase)) { items = items.OrderByDescending(t => t.Date).ToList(); } else if ("Popularity".Equals(SortByField, StringComparison.InvariantCultureIgnoreCase)) { items = items.OrderByDescending(t => t.Popularity).ToList(); } #endregion #region Add Data foreach (var item in items) { SourceItems.Add(item); } #endregion OnPropertyChanged(nameof(Items)); }
private async Task SaveConditions() { await conditionDataProvider.SaveConditions(SourceItems.ToList()); History.MarkAsSaved(); }