public async Task Initialize() { RecentItems.Clear(); ShouldShowRecent = true; var result = await recentManager.GetCollection <RecentItemViewModel>(); var partial = result.OrderByDescending(x => x.LastUsedDate); var showRecent = settings.Get <string>("RecentItemsShown").GetOrDefault(); int takeFirst; if (string.IsNullOrEmpty(showRecent) || showRecent.Equals("No limit")) { RecentItems.AddRange(partial); } else if (int.TryParse(showRecent, out takeFirst)) { RecentItems.AddRange(partial.Take(takeFirst)); } else { ShouldShowRecent = false; } }