AppointmentDialogViewModel constructor

4 posts, 0 answers
  1. Ken
    Ken avatar
    104 posts
    Member since:
    Aug 2010

    Posted 07 Jan 2013 Link to this post

    Hello,

    I've noticed that the public constructor for the AppointmentDialogViewModel class is marked as obsoleted and "will be deleted".

    I'd like to ask you to reconsider deleting it.

    Specifically, our scenario is that we have a split screen which:
    - on the top area shows a ScheduleView
    - on the bottom area shows a GridView of "unassigned" stuff, which can be dragged&dropped onto the ScheduleView for assignment

    For the GridView, when double-clicking any of the items, we want to show almost the same information (95%) as when it would be assigned in the scheduleview. To reuse code we simply create a SchedulerWindow-derived window, set its content to a SchedulerWindow and create an AppointmentDialogViewModel for this window. Everything works great and we actually reuse the UI as well as the window command handlers & stuff.

    If you'll remove the public constructor, any idea how we could accomplish the same scenario? Maybe you could replace the constructor with a factory method?...

    Thanks,
    Adrian
  2. Ken
    Ken avatar
    104 posts
    Member since:
    Aug 2010

    Posted 07 Jan 2013 Link to this post

    Also, there is a bug in the latest version 1129: the public constructor of AppointmentDialogViewModel calls into the internal constructor passing "null" for the value of the "scheduleViewTimeZone" parameter.

    This causes the code to crash on the call to ConvertDateTimeToOneTimeZoneFromAnother, because inside this method "scheduleViewTimeZone"'s GetUtcOffset() method will be called, so a NullReferenceException will be thrown.

    Because of this exception our scenario described in the post above doesn't work at all at the moment. Can you please try to either fix this problem or make the internal constructor public in the next release?

    Thanks,
    Adrian
  3. DevCraft banner
  4. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 10 Jan 2013 Link to this post

    Hi Adrian,

    Thank you for sharing us your scenario.

    We changed the ViewModel slightly during a refactoring of the TimeZone feature and the old constructor cannot initialize the ViewModel correctly. We will consider making the Internal constructor public, but the old one will stay obsolete.

    Kind regards,
    Miroslav Nedyalkov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  5. Ken
    Ken avatar
    104 posts
    Member since:
    Aug 2010

    Posted 10 Jan 2013 Link to this post

    Hi Miroslav,

    Thanks for the answer. I am currently using the same approach, I made the internal constructor public and recompiled the sources. It works fine.

    Regards,
    Adrian
Back to Top