Skip to content

How to show time indicator on a specific time when dragging an appointment in Xamarin.Forms Schedule (Sfschedule)

Notifications You must be signed in to change notification settings

SyncfusionExamples/show-time-indicator-on-drag-and-drop-schedule-xamarin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

How to show time indicator on a specific time when dragging an appointment in Xamarin.Forms Schedule (Sfschedule)

You can show the popup on specific time when do drag and drop the appointment in Xamarin.Forms SfSchedule by using the DragDropSetting ShowTimeIndicator property in a AppointmentDragOver event

You can also refer the following article.

https://www.syncfusion.com/kb/11859/how-to-show-time-indicator-on-a-specific-time-when-dragging-an-appointment-in-xamarin-forms

C#

ShowTimeIndicator property updated in AppointmentDragOver event based on the dragging time.

public class ScheduleBehavior : Behavior<ContentPage>
{
    SfSchedule schedule;
    protected override void OnAttachedTo(ContentPage bindable)
    {
        base.OnAttachedTo(bindable);
        schedule = bindable.FindByName<SfSchedule>("schedule");
        schedule.AppointmentDragOver += schedule_AppointmentDragOver;
    }
    private void schedule_AppointmentDragOver(object sender, AppointmentDragEventArgs e)
    {
        if (e.DraggingTime.Minute == 30 || e.DraggingTime.Minute == 00)
        {
            schedule.DragDropSettings.ShowTimeIndicator = true;
        }
        else
            schedule.DragDropSettings.ShowTimeIndicator = false;
    }
    protected override void OnDetachingFrom(ContentPage bindable)
    {
        base.OnDetachingFrom(bindable);
        schedule.AppointmentDragOver += schedule_AppointmentDragOver;
    }
}

Output

ShowTimeIndicator

About

How to show time indicator on a specific time when dragging an appointment in Xamarin.Forms Schedule (Sfschedule)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages