wp wp8:计划通知

阅读更多
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using wp8Note.Resources;
using Microsoft.Phone.Scheduler;

namespace wp8Note
{
    public partial class MainPage : PhoneApplicationPage
    {
        // 构造函数
        public MainPage()
        {
            InitializeComponent();

          
        }

        private void noteAlarm(object sender, RoutedEventArgs arg)
        {
            Alarm alarm = new Alarm("alarm");
            alarm.Content = "content";
            alarm.Sound = new Uri("/", UriKind.Relative);
            alarm.BeginTime = DateTime.Now;
            alarm.ExpirationTime = DateTime.Now.Add(new TimeSpan(0,3,0));
            alarm.RecurrenceType = RecurrenceInterval.None;
            ScheduledActionService.Add(alarm);
        }

        private void noteReminder(object sender, RoutedEventArgs arg)
        {
            Reminder reminder = new Reminder("reminder");
            reminder.Title = "title";
            reminder.Content = "content";
            reminder.BeginTime = DateTime.Now;
            reminder.ExpirationTime = DateTime.Now.Add(new TimeSpan(0, 3, 0));
            reminder.RecurrenceType = RecurrenceInterval.None;
            //reminder.NavigationUri = new Uri("/", UriKind.Relative);
            ScheduledActionService.Add(reminder);
        }
       
    }
}

你可能感兴趣的:(wp)