如何在Windows Phone中获取约会的详细信息?

时间:2014-02-15 22:08:00

标签: windows-phone appointment

我正在使用此代码在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);
}

现在我需要将约会的主题(或位置和等)作为字符串 请有人帮帮我吗???

1 个答案:

答案 0 :(得分:0)

正如MSDN中所述,您可以从e.Results事件处理程序中的SearchCompleted获取搜索结果预约结果:

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;
        ......
    }
}