2014-06-12 3 views
0

Je veux accéder aux rendez-vous du calendrier dans les fenêtres téléphone 8. J'utilise le code ci-dessous code.this récupérer tous les rendez-vous:Comment accéder à des rendez-spécifiques windowsphone

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"); 
} 

mais je veux pour obtenir et montrer le calendrier spécifique. Par exemple, j'ai trois calendriers dans mon compte Outlook: Calendrier de Mike, Calendrier de travail, Calendrier d'anniversaire. et je veux juste montrer les rendez-vous du calendrier de Mike dans mon application

Dans le calendrier par défaut, nous pouvons facilement cacher ou montrer un calendrier spécifique, mais comment pouvons-nous faire quelque chose comme ça dans notre propre application ????

Répondre

0

Il existe une API Windows Runtime pour obtenir les différents calendriers.

AppointmentStore appointmentStore = await AppointmentManager.RequestStoreAsync(AppointmentStoreAccessType.AllCalendarsReadOnly); 
 

 
      var appCalendars = await appointmentStore.FindAppointmentCalendarsAsync(); 
 
      foreach (var calendar in appCalendars) 
 
      { 
 
      }

Le appCalendars est ce que vous voulez.

Questions connexes