Developer technologies | Universal Windows Platform (UWP)
A Microsoft platform for building and publishing apps for Windows devices.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I'm interested in making a library that can list calendars, insert/modify/remove events from a calendar, and I was wondering if there is an api to access the calendars in the Calendar app similar to how it works in iOS and Android. I haven't seen any documentation for this.
A Microsoft platform for building and publishing apps for Windows devices.
Answer accepted by question author
Look at the classes in the Windows.ApplicationModel.Appointments Namespace. The following will get you started.
AppointmentStore appointmentStore = null;
try
{
appointmentStore = await AppointmentManager.RequestStoreAsync(AppointmentStoreAccessType.AllCalendarsReadOnly);
}
catch (Exception ex)
{
CalendarBox.Text += $"RequestStoreAsync error: {ex.Message}";
return;
}
IReadOnlyList<AppointmentCalendar> appCalendars = null;
try
{
appCalendars = await appointmentStore.FindAppointmentCalendarsAsync();
}
catch (Exception ex)
{
CalendarBox.Text += $"FindAppointmentCalendarsAsync error: {ex.Message}";
return;
}