CreateNew() method returning null

2 posts, 0 answers
  1. Sandi Markon
    Sandi Markon avatar
    101 posts
    Member since:
    Jul 2012

    Posted 16 Jul 2012 Link to this post

    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.
  2. Sandi Markon
    Sandi Markon avatar
    101 posts
    Member since:
    Jul 2012

    Posted 17 Jul 2012 Link to this post

    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.
  3. DevCraft banner
Back to Top