1
我已經學會了如何從本網站創建提醒應用http://www.c-sharpcorner.com/uploadfile/f397b9/reminder-application-in-windows-phone-mango/ 但是從這裏它允許只添加一個提醒。當我提出新的提醒時,以前會被忽略。我如何使它能夠接受多個提醒。下面是我的代碼:添加多個提醒 - Windows手機
void btnSave_Click(object sender, RoutedEventArgs e)
{
DateTime _Date = rDate.Value.Value;
TimeSpan _Time = rTime.Value.Value.TimeOfDay;
_Date = _Date.Date + _Time;
String _Content = titleTBox.Text;
if (_Date < DateTime.Now)
MessageBox.Show("Your time is not match !\nPlease Enter again !");
else if (String.IsNullOrEmpty(_Content))
MessageBox.Show("Your task can't be empty !\n Please enter to do task !");
else
{
ScheduledAction _OldReminder = ScheduledActionService.Find("TodoReminder"); if (_OldReminder != null)
ScheduledActionService.Remove(_OldReminder.Name);
Reminder _Reminder = new Reminder("TodoReminder")
{
BeginTime = _Date,
Title = "Reminder",
Content = _Content,
};
ScheduledActionService.Add(_Reminder);
//MessageBox.Show("Set Reminder Completed");
}
}
您好,我已經測試過了!它工作得很好!非常感謝你的解決方案。 –