Reputation: 324
I would like to open the windows 8 calender through c# code once a button is pressed by the user. Is it possible to open the calender? and if so how can this be achieved?
Thank you in advance :)
Upvotes: 0
Views: 314
Reputation: 21
Also add this to display the results
MessageBox.Show(e.Results.Count().ToString());
Upvotes: 1
Reputation: 21
Try this
private void ButtonAppointments_Click(object sender, RoutedEventArgs e)
{
Appointments appts = new Appointments();
appts.SearchCompleted += new EventHandler<AppointmentsSearchEventArgs>(Appointments_SearchCompleted);
DateTime start = DateTime.Now;
DateTime end = start.AddDays(7);
int max = 10;
//Start the asynchronous search.
appts.SearchAsync(start, end, max, "Appointment");
}
Upvotes: 1
Reputation: 222582
If you have a Windows Phone application that has a page with a button named ButtonAppointments.
private void ButtonAppointments_Click(object sender, RoutedEventArgs e)
{
Appointments appts = new Appointments();
//Identify the method that runs after the asynchronous search completes.
appts.SearchCompleted += new EventHandler<AppointmentsSearchEventArgs>(Appointments_SearchCompleted);
DateTime start = DateTime.Now;
DateTime end = start.AddDays(7);
int max = 20;
//Start the asynchronous search.
appts.SearchAsync(start, end, max, "Appointments Test #1");
}
void Appointments_SearchCompleted(object sender, AppointmentsSearchEventArgs e)
{
//Do something with the results.
MessageBox.Show(e.Results.Count().ToString());
}
Refered from : How to access calendar data for Windows Phone 8
Upvotes: 1