سؤال

I'm using this code to get appointments in windows phone 8

private void SearchAppointments_Click(object sender, RoutedEventArgs e)
{
    Appointments appts = new Appointments();
    appts.SearchCompleted += new EventHandler<AppointmentsSearchEventArgs>(Appointments_SearchCompleted);
    appts.SearchAsync(DateTime.Now,DateTime.Now.AddDays(7),20);
}

now I need to get subject (or location & etc.) of appointments as string Can anybody help me please???

هل كانت مفيدة؟

المحلول

As mentioned in MSDN, you can get search appointment result from e.Results in the SearchCompleted event handler :

private void Appointments_SearchCompleted(object sender, AppointmentsSearchEventArgs e)
{
    foreach (var appointment in e.Results)
    {
        //here you can get each Appointment detail
        String location = appointment.Location;
        String subject = appointment.Subject;
        ......
    }
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top