Esempio n. 1
0
 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 };
         }
     }
 }
Esempio n. 2
0
        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;
            }
        }
Esempio n. 3
0
        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;
            }
        }
Esempio n. 4
0
 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 };
         }
     }
 }