This is a migrated thread and some comments may be shown as answers.

Delete appointment

1 Answer 114 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Rebecca
Top achievements
Rank 1
Rebecca asked on 06 May 2011, 02:45 PM
I have implemented a custom appointment class that is always recurring weekly.
When you hit the delete key on an appointment, neither the AppoinmentDeleting nor the AppointmentDeleted events are fired.
Likewise, these events are not fired if click the "X" button to delete the appointment and you do not select "Delete series" option.

I look forward to hearing any advise on how to handle the appointment delete action.

Thank you.

1 Answer, 1 is accepted

Sort by
0
Rebecca
Top achievements
Rank 1
answered on 06 May 2011, 03:49 PM
I found a solution to my problem which subsequently solved another problem that I was having.

I handled the ShowDialog event and examined the type of DialogViewModel that is property of the ShowDialogEventArgs parameter.

If the DialogViewModel is a RecurrenceChoiceDialogViewModel, I set the RecurrenceChoiceDialogViewModel's IsOccurrenceModeSelected property to False and the IsSeriesModeSeleted property to True so that the series is always edited. By doing so the ScheduleView's AppointmentDeleting and AppointmentDeleted events are fired (I removed the ability for the user to edit these values by supplying a custom style for the ReccurenceChoiceDialog)

I also check if the DialogViewModel is a ConfirmDialogViewModel. I read in this post that when the DialogViewModel is a ConfirmDialogViewModel it means that it is a "Delete confirmation dialog". In this case I added an event handler for the ConfirmationDialogViewModel's Confirmed event. In this method I called the appropriate deleted method for the ScheduleView's CurrentAppointment.

This seems like a round-about-way of accomplishing a delete but it works.
Tags
ScheduleView
Asked by
Rebecca
Top achievements
Rank 1
Answers by
Rebecca
Top achievements
Rank 1
Share this question
or