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

CreateNew() method returning null

1 Answer 48 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Sandi Markon
Top achievements
Rank 1
Sandi Markon asked on 16 Jul 2012, 12:59 PM
Hello everyone,

When does the CreateNew() method return null? This strange behavior happens regardless, whether the AppointmentsSource property is bound to a non-null collection in my ViewModel or the property is explicitly instantiated somewhere along the way (both scenarios create an instance of ObservableCollection<Appointment>).

Maybe you could give me some insight, before i start digging into my code? :)
Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Sandi Markon
Top achievements
Rank 1
answered on 17 Jul 2012, 11:18 AM
UPDATE: I found the culprit. Somewhere in my code, I have an 'AppointmentCreating' event handler, whose task is to cancel the creating of an appointment, if it meets certain criteria. Unfortunately, the appointments I was creating (or was trying to create), were matching the criteria. Clumsy me :)

Thank you anyway.
Tags
ScheduleView
Asked by
Sandi Markon
Top achievements
Rank 1
Answers by
Sandi Markon
Top achievements
Rank 1
Share this question
or