2017-01-21 33 views
1

您可以使用URI方案启动其他应用程序来管理的要求,例如打了一个电话:添加“约会”日历推出URI方案

await Launcher.LaunchUriAsync(new Uri("tel: " + number)); 

我需要使用日历URI方案添加预约到日历(日,小时和标题)在UWP应用程序,但我不知道哪个是日历的标准Uri计划,如果存在。

另一个选择是使用“Outlookcal”来启动Outlook(而不是使用standar uri方案),但我无法找到语法来添加约会的日期,小时和标题,我只知道如何启动Outlook日历:

await Launcher.LaunchUriAsync(new Uri("outlookcal:")); 

任何人都知道如何使用日历Uri方案添加约会,或添加预约的Outlookcal Uri方案?

回答

1

您不必使用URI方案(它似乎没有在任何地方记录)。有可能创建约会directly using the UWP API

//create appointment 
var appointment = new Windows.ApplicationModel.Appointments.Appointment(); 

// ... set its properties 
appointment.StartTime = DateTime.Now + TimeSpan.FromDays(1); 
appointment.Subject = "Meeting subject"; 
appointment.Details = "Meeting description"; 

//show popup to add to calendar 
string appointmentId = 
    await Windows.ApplicationModel.Appointments.AppointmentManager.ShowAddAppointmentAsync(
         appointment, 
         rect, 
         Windows.UI.Popups.Placement.Default); 
+0

这是一个很好的选择,如果没有人知道如何使用uri方案,thx! – CarlosTI

+0

我环顾四周,现在看起来似乎没有其他选择。这似乎没有标准化的URI方案:-( –