2016-05-19 6 views
0

Windows Phone 8.1の予定の保存タスクを使用します。 は、私はWindowsの携帯電話8.1で保存する予定のタスクを達成する方法を、上記のようにWindows Phone 8.1の予定の保存タスクの使用方法

SaveAppointmentTask saveAppointmentTask = new SaveAppointmentTask(); 
      saveAppointmentTask.StartTime = timeconversion.AddMinutes(-10); 
      saveAppointmentTask.Location = sharingProgramTime; // appointment location 
      saveAppointmentTask.Subject = sharingProgramName; // appointment subject 
      saveAppointmentTask.Details = sharingProgramName + sharingProgramTime; // appointment details 
      saveAppointmentTask.IsAllDayEvent = false; 
      saveAppointmentTask.Reminder = Reminder.TenMinutes; 
      saveAppointmentTask.AppointmentStatus = Microsoft.Phone.UserData.AppointmentStatus.Busy; 
      saveAppointmentTask.Show(); 

以下のようにWindowsの携帯電話8のための予定タスクを保存するオプションを持っています。この上の任意のヘルプは

+0

このコードについては何が問題ですか? –

+0

SaveAppointmentTask Windows Phone 8のみに適用されます.Windows Phone 8.1では削除されました – Anbarasi

+0

WinRTまたはSilverlight APIを使用していますか? –

答えて

1

をいただければ幸いあなたがシルバーからWindowsランタイムに移動してきたように、あなたはAppointmentManager class

を使用するように変更する必要がありますa sample in the documentationがありますが、あなたのコードは、ほぼ同等のようになります。

private async void Add-Click(object sender, RoutedEventArgs e) 
{ 
    // Create an Appointment that should be added the user's appointments provider app. 
    var appointment = new Windows.ApplicationModel.Appointments.Appointment(); 

    appointment.StartTime = timeconversion.AddMinutes(-10); 
    appointment.Location = sharingProgramTime; // appointment location 
    appointment.Subject = sharingProgramName; // appointment subject 
    appointment.Details = sharingProgramName + sharingProgramTime; // appointment details 
    appointment.IsAllDayEvent = false; 
    appointment.Reminder = new TimeSpan(0,10,0); // Ten minutes 
    appointment.BusyStatus = AppointmentBusyStatus.Busy; 

    // Get the selection rect of the button pressed to add this appointment 
    var rect = GetElementRect(sender as FrameworkElement); 

    // ShowAddAppointmentAsync returns an appointment id if the appointment given was added to the user's calendar. 
    // This value should be stored in app data and roamed so that the appointment can be replaced or removed in the future. 
    // An empty string return value indicates that the user canceled the operation before the appointment was added. 
    String appointmentId = await Windows.ApplicationModel.Appointments.AppointmentManager.ShowAddAppointmentAsync(
          appointment, rect, Windows.UI.Popups.Placement.Default); 
} 
+0

Hi Rowland Shawこの度はありがとうございました。私は予定を追加する予定のカレンダーを取得することができます。その後、予定表の作成中に**値が予想される範囲**のエラーにならないようになります。あなたはエラーの可能性を導くことができますか?私は価値を渡さなかった。私はあなたがサンプルドキュメントとして提案するようにサンプルを試しました。http://www.getcodesamples.com/src/149C1734/17CF7930 – Anbarasi

関連する問題