2017-10-13 59 views
0

具有參與者的約會,在查詢使用appointment.Invitees屬性時總是返回空集合。Appointment.Invitees在UWP AppointmentManager中始終爲空

這裏就是我試圖做的,

var calendarStore = await AppointmentManager.RequestStoreAsync(AppointmentStoreAccessType.AllCalendarsReadOnly); 
var appointments = await calendarStore.FindAppointmentsAsync(DateTimeOffset.Now, TimeSpan.FromDays(30), new FindAppointmentsOptions() { IncludeHidden = true }); 
foreach (var appointment in appointments) 
{ 
    // appointment.Invitees is always null, even for appointments that has some! 
    foreach (var invitee in appointment.Invitees) 
    { 
     // do something here... 
    } 
} 

我嘗試添加除預約聯繫人功能,但不成功。 有關爲什麼會出現這種奇怪行爲的想法?

回答

0

當訪問Invitees屬性時,需要appointmentsSystem功能。

<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" 
     xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" 
     xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" 
     xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" 
    IgnorableNamespaces="uap mp rescap"> 

<Capabilities> 
    <Capability Name="internetClient"/> 
    <uap:Capability Name="appointments" /> 
    <uap:Capability Name="contacts" /> 
    <rescap:Capability Name="appointmentsSystem" /> 
</Capabilities> 

沒有人可以請求獲得這種能力店面提交

請注意:appointmentsSystem在商店應用無用。

+0

我試圖手動添加這個受限能力到清單文件,但我看到有所作爲。這是我現在擁有的。 <能力> <能力名稱= 「internetClient」/> sudarsanyes