I am implementing a DragAndDropBehavior class and have overwritten the Resize function; however I cannot figure out how to Resize the appointment without passing the state to the MyBase.Resize() method.
I have tried the following to resize the appointment, and the start&end properties of the underlying objects (the appointment) change but visual GUI representation for the appointment does not.
How do I resize the appointment's GUI representation?
Public Overrides Sub Resize(ByVal state As Telerik.Windows.Controls.DragDropState)
Dim draggedAppointment As myCustomAppointment = Nothing
If state.Appointment.GetType Is GetType(Occurrence) Then
draggedAppointment = DirectCast(state.Appointment, Occurrence).Appointment
ElseIf state.Appointment.GetType Is GetType(Appointment) Then
draggedAppointment = DirectCast(state.Appointment, myCustomAppointment)
End If
If draggedAppointment IsNot Nothing Then
Dim startTS As New TimeSpan(state.DestinationSlots(0).Start.DayOfWeek, state.DestinationSlots(0).Start.Hour, state.DestinationSlots(0).Start.Minute, state.DestinationSlots(0).Start.Second)
Dim endTS As New TimeSpan(state.DestinationSlots(0).[End].DayOfWeek, state.DestinationSlots(0).[End].Hour, state.DestinationSlots(0).[End].Minute, state.DestinationSlots(0).[End].Second)
If startTS <> draggedAppointment.TimePeriod.StartTime Then
draggedAppointment.Start = state.DestinationSlots(0).Start
state.DestinationSlots(0).Start = draggedAppointment.Start
End If
If endTS <> draggedAppointment.TimePeriod.EndTime Then
draggedAppointment.End = state.DestinationSlots(0).End
state.DestinationSlots(0).End = draggedAppointment.End
End If
End If
'MyBase.Resize(state)
End Sub
Thank you for your time.
I have tried the following to resize the appointment, and the start&end properties of the underlying objects (the appointment) change but visual GUI representation for the appointment does not.
How do I resize the appointment's GUI representation?
Public Overrides Sub Resize(ByVal state As Telerik.Windows.Controls.DragDropState)
Dim draggedAppointment As myCustomAppointment = Nothing
If state.Appointment.GetType Is GetType(Occurrence) Then
draggedAppointment = DirectCast(state.Appointment, Occurrence).Appointment
ElseIf state.Appointment.GetType Is GetType(Appointment) Then
draggedAppointment = DirectCast(state.Appointment, myCustomAppointment)
End If
If draggedAppointment IsNot Nothing Then
Dim startTS As New TimeSpan(state.DestinationSlots(0).Start.DayOfWeek, state.DestinationSlots(0).Start.Hour, state.DestinationSlots(0).Start.Minute, state.DestinationSlots(0).Start.Second)
Dim endTS As New TimeSpan(state.DestinationSlots(0).[End].DayOfWeek, state.DestinationSlots(0).[End].Hour, state.DestinationSlots(0).[End].Minute, state.DestinationSlots(0).[End].Second)
If startTS <> draggedAppointment.TimePeriod.StartTime Then
draggedAppointment.Start = state.DestinationSlots(0).Start
state.DestinationSlots(0).Start = draggedAppointment.Start
End If
If endTS <> draggedAppointment.TimePeriod.EndTime Then
draggedAppointment.End = state.DestinationSlots(0).End
state.DestinationSlots(0).End = draggedAppointment.End
End If
End If
'MyBase.Resize(state)
End Sub
Thank you for your time.