Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.Scheduler.dll
Syntax:
public class AppointmentDraggingBehavior : RadDragDropService, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, IMessageListener
Inheritance: objectDisposableObjectRadObjectRadServiceRadDragDropServiceAppointmentDraggingBehavior...
Implements:
Inherited Members
Constructors
public AppointmentDraggingBehavior(SchedulerVisualElement activeOwner)
Properties
Gets the active feedback.
public DragFeedbackElement ActiveFeedback { get; }
Gets the behavior's active owner.
public SchedulerVisualElement ActiveOwner { get; }
Gets or sets a value indicating whether the appointment areas in DayView should be automatically scrolled when dragging off their bounds.
public bool AutoScrollDayViewOnDrag { get; set; }
Gets or sets the minimum time interval between automatic view navigations.
public TimeSpan DragNavigationInterval { get; set; }
Gets or sets the offset from the bounds of the control in pixels after which the automatic view navigation will be triggered.
public int DragNavigationOffset { get; set; }
Indicates whether there is an active drag operation.
public bool IsDragging { get; }
The RadScheduler that owns the behaviors.
public RadScheduler Scheduler { get; }
Gets or sets a value indicating whether a prompt dialog box should be shown when the user is about to create occurrence exception via drag and drop.
public bool ShowCreateExceptionDialog { get; set; }
Gets or sets a value indicating whether a message box should be shown when an occurrence is dragged to an invalid location.
public bool ShowOccurrenceValidationMessages { get; set; }
Methods
Adds the active feedback to the active owner.
Request move operation.
public bool BeginDrag(SchedulerVisualElement newOwner, AppointmentElement appointment)
Determines whether the service may be started. Validation is as follows:
- Check whether Enabled is true.
- Check the context through IsContextValid method. An exception is thrown if context is invalid.
- Checks the current state - it should be Initial or Stopped.
Creates a new appointment feedback of a given appointment.
public virtual DragFeedbackElement CreateFeedback(RadScheduler scheduler, SchedulerView view, AppointmentElement appointment)
Handles dragging the active feedback to a given point.
public void DoDragOver(Point controlDropLocation)
The destination point in control coordinates.
Handles the Drop operation.
public virtual void Drop()
Gets a DayViewAllDayHeader at a specified location.
protected DayViewAllDayHeader GetAllDayHeaderAtPoint(Point location)
The location in control coordinates.
Returns:The DayViewAllDayHeader at that location.
Gets a SchedulerCellElement at a specified location.
protected SchedulerCellElement GetCellAtPoint(Point location)
The location in control coordinates.
Returns:The SchedulerCellElement at that location.
Gets the destination date for an appointment that was dropped on a given cell.
protected virtual DateTime GetCellDate(SchedulerCellElement cell)
The SchedulerCellElement.
Returns:The destination date.
Gets a DayViewAppointmentsTable at a specified location.
protected DayViewAppointmentsTable GetDayViewTableAtPoint(Point location)
The location in control coordinates.
Returns:The DayViewAppointmentsTable at that location.
Gets a specific feedback.
public DragFeedbackElement GetFeedback(SchedulerVisualElement feedbackOwnerElement)
Gets a MonthViewAreaElement at a specified location.
protected MonthViewAreaElement GetMonthViewAreaAtPoint(Point location)
The location in control coordinates.
Returns:The MonthViewAreaElement at that location.
Gets a TimelineAppointmentsPresenter at a specified location.
protected TimelineAppointmentsPresenter GetTimelinePresenterAtPoint(Point location)
The location in control coordinates.
Returns:The TimelineAppointmentsPresenter at that location.
Hides the active feedbacks.
protected virtual void InitializeSettings(AppointmentElement appointment)
Gets whether the element is found in the owners collection.
public bool IsElementOwner(SchedulerVisualElement owner)
Moves the feedback to a specific date in a specific resource.
public virtual bool Move(DateTime newDate, SchedulerCellElement cell, SchedulerVisualElement newOwner)
The destination date.
cellSchedulerCellElementThe destination cell.
newOwnerSchedulerVisualElementThe destination visual element.
Returns:[true] if the move was performed, [false] otherwise
Moves the active feedback to a new owner.
public virtual void MoveFeedback(SchedulerVisualElement newOwner)
The new owner of the feedback.
protected virtual void OnAppointmentDropped(AppointmentMovedEventArgs args)
protected virtual void OnAppointmentDropping(AppointmentMovingEventArgs args)
protected virtual void OnAppointmentMoved()
protected virtual void OnAppointmentMovingEventArgs(AppointmentMovingEventArgs args)
protected virtual void OnFeedbackCreating(FeedbackCreatingEventArgs args)
protected virtual void OnInitializing(FeedbackInitializingEventArgs args)
protected override void OnPreviewDragDrop(RadDropEventArgs e)
Overrides:
protected override void OnPreviewDragHint(PreviewDragHintEventArgs e)
Overrides:
protected override void OnPreviewDragOver(RadDragOverEventArgs e)
Overrides:
Stops the service. Performs the core logic.
protected override void PerformStop()
Overrides:
Removes the visual feedback. Cancels the drag operation.
public virtual bool RemoveFeedback(SchedulerVisualElement owner)
protected virtual void ResetCellsHoverState()
protected void SetAppointmentVisibility(IEvent appointment, ElementVisibility visibility)
Events
Occurs when drag drop has finished.
public event EventHandler<AppointmentMovedEventArgs> AppointmentDropped
Occurs when drag drop is finishing.
public event EventHandler<AppointmentMovingEventArgs> AppointmentDropping
Occurs when an appointment is moved.
public event EventHandler AppointmentMoved
Occurs when an appointment is moving.
public event EventHandler<AppointmentMovingEventArgs> AppointmentMoving
Occurs when the feedback is creating.
public event EventHandler<FeedbackCreatingEventArgs> FeedbackCreating
Occurs when the feedback is initialized.
public event EventHandler<FeedbackInitializingEventArgs> FeedbackInitialized