我正在使用此代码在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);
}
现在我需要将约会的主题(或位置和等)作为字符串 请有人帮帮我吗???
答案 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;
......
}
}