Back to Devexpress

ReminderItem.AlertTime Property

wpf-devexpress-dot-xpf-dot-scheduling-dot-reminderitem-5df8bb23.md

latest5.0 KB
Original Source

ReminderItem.AlertTime Property

Gets or sets the date and time for firing an alert.

Namespace : DevExpress.Xpf.Scheduling

Assembly : DevExpress.Xpf.Scheduling.v25.2.dll

NuGet Package : DevExpress.Wpf.Scheduling

Declaration

csharp
public DateTime AlertTime { get; set; }
vb
Public Property AlertTime As Date

Property Value

TypeDescription
DateTime

A DateTime object which specifies the reminder’s alert time.

|

Remarks

When the time specified by the AlertTime property arrives, the reminder is added to the SchedulerControl.TriggeredReminders collection, the SchedulerControl.RemindersWindowShowing event occurs and the Recurrence Window dialog is invoked.

Default value of the AlertTime property is calculated as follows:

ReminderItem.AlertTime = AppointmentItem.Start - ReminderItem.TimeBeforeStart.

You can set the AlertTime value explicitly in code. In this situation, the ReminderItem.TimeBeforeStart value remains unchanged and the formula does not apply.

Note

The ReminderItem.AlertTime value determines when to fire an alert. The ReminderItem.TimeBeforeStart value is displayed and set in the Recurrence Window dialog.

Example

View Example

csharp
// Remove previous reminders
appointment.Reminders.Clear();
// Set multiple reminders for an appointment
ReminderItem reminder1 = appointment.CreateNewReminder();
ReminderItem reminder2 = appointment.CreateNewReminder();
reminder1.AlertTime = DateTime.Now.AddMinutes(15);
reminder2.TimeBeforeStart = new TimeSpan(0, 30, 0);

appointment.Reminders.Add(reminder1);
appointment.Reminders.Add(reminder2);
vb
' Remove previous reminders
appointment.Reminders.Clear()
' Set multiple reminders for an appointment
Dim reminder1 As ReminderItem = appointment.CreateNewReminder()
Dim reminder2 As ReminderItem = appointment.CreateNewReminder()
reminder1.AlertTime = Date.Now.AddMinutes(15)
reminder2.TimeBeforeStart = New TimeSpan(0, 30, 0)

appointment.Reminders.Add(reminder1)
appointment.Reminders.Add(reminder2)

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the AlertTime property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-scheduler-create-reminders-in-code-and-implement-custom-reminder-window/CS/CustomReminderExample/MainWindow.xaml.cs#L37

csharp
ReminderItem reminder2 = appointment.CreateNewReminder();
reminder1.AlertTime = DateTime.Now.AddMinutes(15);
reminder2.TimeBeforeStart = new TimeSpan(0, 30, 0);

wpf-scheduler-create-reminders-in-code-and-implement-custom-reminder-window/VB/CustomReminderExample/MainWindow.xaml.vb#L40

vb
Dim reminder2 As ReminderItem = appointment.CreateNewReminder()
reminder1.AlertTime = Date.Now.AddMinutes(15)
reminder2.TimeBeforeStart = New TimeSpan(0, 30, 0)

See Also

ReminderItem Class

ReminderItem Members

DevExpress.Xpf.Scheduling Namespace