How to use the save appointment task for Windows Phone 8
Applies to: Windows Phone 8 and Windows Phone Silverlight 8.1 only
Use the save appointment task to enable users to save an appointment from your application. The task launches the calendar application and displays a new appointment. You can optionally specify several properties of the appointment which are prepopulated in the new appointment. The message is saved only when the user presses the save button.
By using Launchers, you help provide a consistent user experience throughout the Windows Phone platform. For more information, see Launchers and Choosers for Windows Phone 8.
To use the save appointment task
Add the following statement to your code.
Add the following code to your application wherever you need it, such as in a button click event. To test this procedure, you can put the code in the page constructor. This is the code to launch the task.
SaveAppointmentTask saveAppointmentTask = new SaveAppointmentTask(); saveAppointmentTask.StartTime = DateTime.Now.AddHours(2); saveAppointmentTask.EndTime = DateTime.Now.AddHours(3); saveAppointmentTask.Subject = "Appointment subject"; saveAppointmentTask.Location = "Appointment location"; saveAppointmentTask.Details = "Appointment details"; saveAppointmentTask.IsAllDayEvent = false; saveAppointmentTask.Reminder = Reminder.FifteenMinutes; saveAppointmentTask.AppointmentStatus = Microsoft.Phone.UserData.AppointmentStatus.Busy; saveAppointmentTask.Show();