我正在使用此示例代码来获取日历约会。我想将项目转换为字符串:例如在消息框中显示第一项。解决办法是什么??
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(1), 2,null);
}
void Appointments_SearchCompleted(object sender, AppointmentsSearchEventArgs e)
{
try
{
//Bind the results to the list box that displays them in the UI.
AppointmentResultsData.DataContext = e.Results;
}
catch (System.Exception)
{
//That's okay, no results.
}
}