For various reasons I've implemented a custom control to handle the editing and creating of appointments. It works fine for everything, however there is one problem which is that when an appointment is drag and dropped, or resized, my custom control is being opened and I need to prevent this from happening (when using the standard approach the edit dialog is not opened after dragging/dropping or resizing, so I need to reproduce this behaviour).
I am using MVVM.
Schedule View Event Trigger:
Command within View Model
editAppointment then opens a custom control with the ScheduledItemViewModel as the Data Context. This approach appears to work without issue when editing appointments normally.
I also have an Event Handler in the code behind page that handles the ShowDialog event of the Schedule View control which I use to suppress other various dialogs. However this event does not appear to get fired when Dragging/Dropping or resizing.
Any help would be appreciated.
I am using MVVM.
Schedule View Event Trigger:
<
i:EventTrigger
EventName
=
"AppointmentEditing"
>
<
mvvme:EventToCommand
Command
=
"{Binding AppointmentEditingCommand}"
PassEventArgsToCommand
=
"True"
/>
</
i:EventTrigger
>
Command within View Model
public
ICommand AppointmentEditingCommand
{
get
{
return
new
RelayCommand<AppointmentEditingEventArgs>((e) =>
{
ScheduledItemViewModel appointmentToEdit =
new
ScheduledItemViewModel();
appointmentToEdit.CopyFrom(e.Appointment);
editAppointment(appointmentToEdit);
});
}
}
editAppointment then opens a custom control with the ScheduledItemViewModel as the Data Context. This approach appears to work without issue when editing appointments normally.
I also have an Event Handler in the code behind page that handles the ShowDialog event of the Schedule View control which I use to suppress other various dialogs. However this event does not appear to get fired when Dragging/Dropping or resizing.
Any help would be appreciated.