Reminder in WPF Scheduler (SfSchedule)

Schedule alerts you for particular appointment with reminder window when enable the EnableReminderTimer property. Reminder window supports to Dismiss or DismissAll or set the SnoozeTime for reminder appointments.

Setting reminder for an Appointment

Reminder can be set by setting the EnableReminderTimer property is true.The remainder time can be set using the ReminderTime property of ScheduleAppointment.

<Grid>
    <syncfusion:SfSchedule x:Name="schedule" ScheduleType="Month" EnableReminderTimer="True"/>
</Grid>
schedule.Appointments.Add(new ScheduleAppointment
{
    StartTime = DateTime.Now.Date.AddHours(9),
    EndTime   = DateTime.Now.Date.AddHours(12),
    AppointmentBackground = new SolidColorBrush(Color.FromArgb(0xFf, 0xA2, 0xC1, 0x39)),
    Subject = "Business Meeting",
    ReminderTime = ReminderTimeType.TenHours
});

schedule.Appointments.Add(new ScheduleAppointment
{
    StartTime = currentDate.Date.AddDays(1).AddHours(10),
    EndTime = currentDate.Date.AddDays(1).AddHours(16),
    AppointmentBackground = new SolidColorBrush(Color.FromArgb(0xFf, 0xD8, 0x00, 0x73)),
    Subject = "Auditing",
    ReminderTime = ReminderTimeType.TwoDays
});

schedule.Appointments.Add(new ScheduleAppointment
{
    StartTime = DateTime.Now.Date.AddDays(7).AddHours(10),
    EndTime = DateTime.Now.Date.AddDays(7).AddHours(13),
    AppointmentBackground = new SolidColorBrush(Color.FromArgb(0xFf, 0xF0, 0x96, 0x09)),
    Subject = "Conference",
    ReminderTime = ReminderTimeType.TwoWeeks
});

WPF Scheduler Reminder Window

Download demo from GitHub

Configuring Reminder Duration

Scheduler supports to set the reminder duration time to remind the appointments by using the ReminderTime property of ScheduleAppointment.

schedule.Appointments[0].ReminderTime = ReminderTimeType.FifteenMin;

Create a custom binding for ReminderTime

ReminderTime supports to map your custom object with ScheduleAppointment.ReminderTime.

/// <summary>
/// Represents custom data properties.
/// </summary>
public class Meeting
{
    public String Subject { get; set; }
    public DateTime StartTime { get; set; }
    public DateTime EndTime { get; set; }
    public Brush AppointmentColor { get; set; }
    public ReminderTimeType ReminderTime { get; set; }
}

NOTE

You can inherit this class from INotifyPropertyChanged for dynamic changes in custom data.

You can map those properties of Meeting class with our SfSchedule control by using AppointmentMapping and ScheduleAppointmentMapping.

<syncfusion:SfSchedule x:Name="schedule" ScheduleType="Month" DataSource="{Binding Meetings}">
    <syncfusion:SfSchedule.AppointmentMapping>
        <syncfusion:ScheduleAppointmentMapping
            SubjectMapping="Subject"
            AppointmentBackgroundMapping="AppointmentColor"
            StartTimeMapping="StartTime"
            EndTimeMapping="EndTime"
            ReminderTimeMapping="ReminderTime">
        </syncfusion:ScheduleAppointmentMapping>
    </syncfusion:SfSchedule.AppointmentMapping>
</syncfusion:SfSchedule>
// Schedule data mapping for custom appointments
ScheduleAppointmentMapping dataMapping = new ScheduleAppointmentMapping();
dataMapping.SubjectMapping = "Subject";
dataMapping.StartTimeMapping = "StartTime";
dataMapping.EndTimeMapping = "EndTime";
dataMapping.AppointmentBackgroundMapping = "AppointmentColor";
dataMapping.ReminderTimeMapping = "ReminderTime";
schedule.AppointmentMapping = dataMapping;

Download demo from GitHub

Handling Reminder events

ReminderOpening event

ReminderOpening – occurs when appearing the reminder window.

ReminderControlOpeningEventArgs has following property.

RemindAppCollection – Gets list of reminder appointments.

You can prevent the reminder window opening through ReminderControlOpeningEventArgs.Cancel property of ReminderOpening event.

this.Schedule.ReminderOpening += Schedule_ReminderOpening;
private void Schedule_ReminderOpening(object sender, ReminderControlOpeningEventArgs e)
{
    e.Cancel = true;
}

ReminderClosed event

ReminderClosed – occurs when closing the reminder window.
ReminderControlClosedEventArgs provides information for ReminderClosed event.

ReminderFormActionChanged event

ReminderFormActionChanged – occurs when change the reminder window action for the appointment.

ReminderFormActionChangedEventArgs has following properties which provides information for ReminderFormActionChanged event.

Action - Gets the action of schedule appointments.

Appointments – Gets list of appointments that are changed.

SnoozeTime – Gets the snooze time of action changed appointments.

Download demo from GitHub