Hi there again!
I have ignored this problem until now, because it has not actually affected my, but now it might do so?
I have reproduced the problem in you test project attached to a previous post.
It occurs if I change an extended property in code behind.
I can't send you a test project but I try to explain the differences in big.
The difference in my solution from your test project is that I don't use the standard edit appointment dialog, I have a compleately different ChildWindow, which implements the IScheduleViewDialogHost interface.
The dialog has a public property where I set the selected appointment from the ScheduleView when opening the dialog.
I also populate fields in the dialog from this property (they are not bound in XAML, but set in code behind).
When the dialog is closing, I update the public appointment property with modifications made in the dialog.
In the dialog factory I subscribe to the dialog closed event and fetch the appointment from the public property in the dialog.
Then I update the appointment in my viewmodel with modifications made in the dialog.
As you can see I pass a copy of the appointment between the ScheduleView and the dialog and back again.
The reason is that my edit dialog it quite advanced so I can not bind everyting as simple as you can.
This hasn't really been a problem, because I have always saved and refetched the appointment immediately after closing the dialog.
Now I'm implementing a function where the user should be able to add and modify several appointments before saving all of them in a batch. The problem that occurs now is that I create a new appointment by double clicking an empty slot. I double click it again and it opens up correctly in the edit dialog. I cancel the dialog and double click it again, this time a get a new appointment though...
The second time, just before opening the dialog, it goes into the CopyFrom method in my custom appointment class, but not the first time.
This was a very long explanation and I don't know if the original problem posted has anything to do with this.
But an easy repro of the extended properties not updated in your test project is to add a closed event in the factory and in that event do this:
private void editShiftDialog_Closed(object sender, WindowClosedEventArgs e)
Window dialog = sender as Window;
if (dialog != null)
CustomAppointment app = dialog.ScheduleView.SelectedAppointment as CustomAppointment;
if (app != null)
app.IsDone = true;
Create a new appointment, open it again, do not check 'Is Done', put a breakpoint in the closed event at the line where IsDone is set to true, inspect the appointment, then the private property isDone will still be false...