欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

wp wp8:计划通知

程序员文章站 2022-04-30 10:02:11
...
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