void contacts_SearchCompleted(object sender, ContactsSearchEventArgs e) { if (!e.Results.Any()) { var items = new DateStringDisplay { StartTime = "Add birthdays to your contacts to see them here...", Subject = string.Empty }; BirthdaysListBox.ItemsSource = new[] { items }; } else { var birthdays = (from contact in e.Results let birthday = contact.Birthdays.FirstOrDefault() where birthday != DateTime.MinValue select new DateDisplay { StartTime = birthday, Subject = contact.DisplayName }).ToList(); if (birthdays.Count > 0) { BirthdaysListBox.ItemsSource = birthdays; } else { var items = new DateStringDisplay { StartTime = "Add birthdays to your contacts to see them here...", Subject = string.Empty }; BirthdaysListBox.ItemsSource = new[] { items }; } } }
void appointments_SearchCompleted(object sender, AppointmentsSearchEventArgs e) { if (!e.Results.Any()) { var items = new DateStringDisplay { StartTime = "Add some events to your calendar to see them here...", Subject = string.Empty }; CalendarListBox.ItemsSource = new[] { items }; } else { var items = e.Results.Select(i => new DateDisplay { StartTime = i.StartTime, Subject = i.Subject }); CalendarListBox.ItemsSource = items; } if (loading) { GlobalLoading.Instance.IsLoading = false; GlobalLoading.Instance.LoadingText = null; loading = false; } }
void appointments_SearchCompleted(object sender, AppointmentsSearchEventArgs e) { if (!e.Results.Any()) { var items = new DateStringDisplay { StartTime = "Add some events to your calendar to see them here...", Subject = string.Empty }; CalendarListBox.ItemsSource = new[] { items }; } else { var items = e.Results.Select(i => new DateDisplay { StartTime = i.StartTime, Subject = i.Subject }); CalendarListBox.ItemsSource = items; } if (loading) { GlobalLoading.Instance.IsLoading = false; GlobalLoading.Instance.LoadingText = null; loading = false; } }
void contacts_SearchCompleted(object sender, ContactsSearchEventArgs e) { if (!e.Results.Any()) { var items = new DateStringDisplay { StartTime = "Add birthdays to your contacts to see them here...", Subject = string.Empty }; BirthdaysListBox.ItemsSource = new[] { items }; } else { var birthdays = (from contact in e.Results let birthday = contact.Birthdays.FirstOrDefault() where birthday != DateTime.MinValue select new DateDisplay { StartTime = birthday, Subject = contact.DisplayName }).ToList(); if (birthdays.Count > 0) { BirthdaysListBox.ItemsSource = birthdays; } else { var items = new DateStringDisplay { StartTime = "Add birthdays to your contacts to see them here...", Subject = string.Empty }; BirthdaysListBox.ItemsSource = new[] { items }; } } }