Alarm & Reminder學習

來源:互聯網
上載者:User

今天抽看看了一下Windows phone7.1 SDK,還有一些類庫沒有用過,研究了一下Microsoft.Phone.Scheduler中的Alarm和Reminder.

Alarm 鬧鈴

下面看一下它常用的屬性~

Alarm alarm = new Alarm(name);

//提醒內容
alarm.Content = contentTextBox.Text;

//鬧鈴的音樂
alarm.Sound = new Uri("/system.wav", UriKind.Relative);

//開始時間
alarm.BeginTime = beginTime;

//到期時間
alarm.ExpirationTime = expirationTime;

//重複的類型
alarm.RecurrenceType = recurrence;

//重複類型包括以下幾種:

RecurrenceInterval.Daily,RecurrenceInterval.Weekly, RecurrenceInterval.Monthly,RecurrenceInterval.EndOfMonth,RecurrenceInterval.Yearly幾種

//最後別忘了加入ScheduledActionService對象中

ScheduledActionService.Add(alarm);

運行結果:

Reminder提醒

同樣看下它的屬性:

Reminder reminder = new Reminder(name);

//提醒的標題
reminder.Title = titleTextBox.Text;

//提醒的內容
reminder.Content = contentTextBox.Text;

//開始時間
reminder.BeginTime = beginTime;

//終止時間
reminder.ExpirationTime = expirationTime;

//重複類型,同上
reminder.RecurrenceType = recurrence;

//提醒資訊顯示的頁面
reminder.NavigationUri = navigationUri;

//同上

ScheduledActionService.Add(reminder);

 功能很簡單,用法也很簡單,只要熟悉其屬性就OK了!~

 

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.