How to hide the application calendar from the built-in calendar application?

My application needs an internal calendar. I can create a new calendar as follows:

var store = await AppointmentManager.RequestStoreAsync(AppointmentStoreAccessType.AppCalendarsReadWrite); var cacheCalendar = await store.CreateAppointmentCalendarAsync("unique name here"); 

It succeeds, and I get a new calendar. But this calendar is displayed in the built-in calendar application. I do not want this calendar to be visible, as it is intended for internal accounting.

So, I am trying to hide the calendar as follows:

 var store = await AppointmentManager.RequestStoreAsync(AppointmentStoreAccessType.AppCalendarsReadWrite); var cacheCalendar = await store.CreateAppointmentCalendarAsync("unique name here"); cacheCalendar.IsHidden = true; // <---- make calendar hidden await cacheCalendar.SaveAsync(); // <---- save; error here 

When calling SaveAsync , the following exception is thrown:

Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) "

Why can't I hide my calendar from the phoneโ€™s built-in calendar application? Is this an undocumented restriction? Are there other ways to do this?

(Note: I tested this on Windows 10 Mobile, as well as on the Win 10 desktop - the same error.)

Edit / Add . Since Anthony discovered that the IsHidden property IsHidden documented as read-only on MSDN, this is a screenshot from Visual Studio showing the public setter (which makes it compile, run, and seemingly the right to call):

IsHidden property has a setter

(The application is intended for Win 10 Build 10586 - perhaps it is new, but unfinished?)

+7
windows-10 uwp windows-10-universal windows-10-mobile uwp-xaml
source share
2 answers

It was a mistake in 10586, but if you use the 14393 SDK, you can use IsHidden if your application has calendar rights without an InvalidAccessException

https://wpdev.uservoice.com/forums/110705-universal-windows-platform/suggestions/15278775-appointmentcalendar-ishidden-setter-throws-a-inval

+1
source share

Honestly, I am surprised that this even compiles.

According to MSDN documentation for AppointmentCalandar

IsHidden . Only for reading. Gets whether the appointment calendar is hiding. calendar user interface

This property is read-only and cannot be set .

As for your actual question, after carefully reviewing the documentation, it looks like this is oversight in the API. I would raise this concern on MSDN forums.

+4
source share

All Articles