Example #1
0
        async void DoneClicked(object sender, EventArgs e)
        {
            currentReminder.SetTimeToDisplay();
            currentReminder.SetUnChecked();
            ReminderManager reminderManeger = ReminderManager.DefaultManager;
            await reminderManeger.SaveTaskAsync(currentReminder, isNewItem);

            App.contentChanged = true;
            DateTime notiTime = new DateTime(
                DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day,
                currentReminder.Time.Hours, currentReminder.Time.Minutes, 0
                );

            if (DateTime.Compare(notiTime, DateTime.Now) < 0)
            {
                notiTime = notiTime.AddDays(1);
            }
            CrossLocalNotifications.Current.Show("Medicine Notification",
                                                 "It's time to take " + currentReminder.MedicineName, currentReminder.GetHashCode(),
                                                 notiTime);

            await Navigation.PopAsync();
        }
Example #2
0
 public void DeleteNotification(Reminder reminder)
 {
     CrossLocalNotifications.Current.Cancel(reminder.GetHashCode());
 }
        public void SetNotification(Reminder reminder)
        {
            DateTime notiTime = new DateTime(
                DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day,
                reminder.Time.Hours, reminder.Time.Minutes, 0
                );

            if (DateTime.Compare(notiTime, DateTime.Now) < 0)
            {
                notiTime = notiTime.AddDays(1);
            }
            CrossLocalNotifications.Current.Show("Medicine Notification",
                                                 "It's time to take " + reminder.MedicineName, reminder.GetHashCode(),
                                                 notiTime);
        }