ViewBase.Tap Event
Fires when users tap on the scheduler view.
Namespace: DevExpress.Maui.Scheduler
Assembly: DevExpress.Maui.Scheduler.dll
NuGet Package: DevExpress.Maui.Scheduler
Declaration
public event SchedulerGestureEventHandler Tap
Event Data
The Tap event's data class is SchedulerGestureEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
AppointmentInfo | Returns information about an appointment with which an user interacts. |
IntervalInfo | Returns information about a time interval with which a user interacts. |
Location | Returns coordinates of the screen point to which user tapped. |
Example
This example displays AppointmentEditPage to edit general appointment, pattern, occurrence, or to add a new appointment when a user taps on the scheduler day view:
const string EditPatternAction = "Edit pattern";
const string EditOccurrenceAction = "Edit occurrence";
const string EditNormalAction = "Edit";
async void Handle_OnTap(object sender, SchedulerGestureEventArgs e) {
if (e.AppointmentInfo != null) {
string selectedAction = await DisplaySelectAppointmentEditActionSheet(e.AppointmentInfo.Appointment);
switch (selectedAction) {
case EditPatternAction:
PushEditAppointmentPage(storage.GetPattern(e.AppointmentInfo.Appointment));
break;
case EditOccurrenceAction:
case EditNormalAction:
PushEditAppointmentPage(e.AppointmentInfo.Appointment);
break;
default:
break;
}
} else {
if (e.IntervalInfo != null) { PushNewAppointmentPage(e.IntervalInfo); }
}
}
async void PushEditAppointmentPage(AppointmentItem target) {
var page = new AppointmentEditPage(target, storage);
await Navigation.PushAsync(page);
}
async void PushNewAppointmentPage(IntervalInfo info) {
var page = new AppointmentEditPage(info.Start, info.End, info.AllDay, storage);
await Navigation.PushAsync(page);
}
async Task<String> DisplaySelectAppointmentEditActionSheet(AppointmentItem target) {
string[] actions = null;
string deleteAction = null;
switch (target.Type) {
case AppointmentType.Normal:
actions = new string[] { EditNormalAction };
break;
default:
actions = new string[] { EditPatternAction, EditOccurrenceAction };
break;
}
return await this.DisplayActionSheet(null, "Cancel", null, actions);
}
The following table contains classes and members the example uses:
Symbol | Description |
---|---|
| Fires when users tap on the scheduler view. |
Returns a pattern of the specified occurrence or exception. | |
The page that allows users to add new and edit existing appointments. |