How to Save an Appointment in Windows Phone 8 using C# ?

Published on July 31, 2014 by abundantcode

Filed under Windows Phone

Last modified July 31, 2014

Print this page

rate 1 star rate 2 star rate 3 star rate 4 star rate 5 star
Your rating: none, Average: 1 (1 votes)

This article have been viewed 3361 times

If you want to allow the user to create or save an appointment within the Calendar application in Windows Phone 8 , you can do it using the SaveAppointmentTask launcher.

How to Save an Appointment in Windows Phone 8 using C# ?

To use the SaveAppointmentTask launcher , first enable the ID_CAP_APPOINTMENTS in the WMAppManifest file.

Create an instance of the SaveAppointmentTask class and set appropriate properties and then call the show method of the SaveAppointmentTask object.

Below is a sample code snippet demonstrating how to add or save the appointment in Windows Phone 8 programmatically using C#.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using AbundantcodeWindowsPhone8Tutorial.Resources;
using Microsoft.Phone.Tasks;

namespace AbundantcodeWindowsPhone8Tutorial
{
    public partial class MainPage : PhoneApplicationPage
    {
        public MainPage()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            SaveAppointmentTask appointment = new SaveAppointmentTask();
            appointment.StartTime = DateTime.Now.AddDays(1);
            appointment.EndTime = DateTime.Now.AddDays(2); ;
            appointment.Location = "London";
            appointment.Subject = ".NET Conference";
            appointment.Show();
        }
    }
}

image

 

image

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Leave a Comment


x

You might be Interested in these Posts

C# and Lambda - Finding all the elements of an integer array less than 35

Here's a sample code snippet demonstrating how to find all the elements of an integer array that is ...

C# and LINQ - Finding all the elements of an integer array less than 35

Here's a sample code snippet demonstrating how to find all the elements of an integer array that is ...

How to use array Rank in C# ?

In C# , the Rank property of the array is is used to get the rank of the array. In simple terms , ra...