private async void UpdateJumplist(string propName) { try { if (propName == "Year" || propName == "TrackNumber") { AlphabetList = TracksCollection.Keys.DistinctBy(t => t).ToList(); } else if (propName == "Length") { AlphabetList = TracksCollection.Keys.Select(t => t.Replace(" minutes", "")).DistinctBy(a => a).ToList(); } else if (propName == "FolderPath") { AlphabetList = TracksCollection.Keys.Select(t => new DirectoryInfo(t).Name.Remove(1)).DistinctBy(t => t).ToList(); } else { AlphabetList = "&#ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray().Select(x => x.ToString()).ToList(); } AlphabetList.Sort(); } catch (ArgumentOutOfRangeException ex) { await NotificationManager.ShowMessageAsync("Unable to update jumplist due to some problem with TracksCollection. ERROR INFO: " + ex.Message); } }
void UpdateJumplist(string propName) { if (propName == "Year" || propName == "TrackNumber") { AlphabetList = TracksCollection.Keys.DistinctBy(t => t).ToList(); } else if (propName == "Length") { AlphabetList = TracksCollection.Keys.Select(t => t.Replace(" minutes", "")).DistinctBy(a => a).ToList(); } else if (propName == "FolderPath") { AlphabetList = TracksCollection.Keys.Select(t => new DirectoryInfo(t).Name.Remove(1)).DistinctBy(t => t).ToList(); } else { AlphabetList = "&#ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray().Select(x => x.ToString()).ToList(); } AlphabetList.Sort(); }