Setting PeriodStart/End and VisiblePeriodStart/End at the same time via bindings

4 posts, 0 answers
  1. James
    James avatar
    7 posts
    Member since:
    Jul 2012

    Posted 22 May 2013 Link to this post

    In my MVVM application, there is a RadTimeBar hosting a RadAreaSparkline to give the user an overview of the data.  When a period of time is selected, the SelectionStart and SelectionEnd values are used to query a detailed set of data that is then displayed in a RadTimeline.

    After the selection is made, I would like the RadTimeline to have its PeriodStart/End set to match the SelectionStart/End times of the RadTimeBar.  This functionality is working.

    At the same time that the RadTimeline has its PeriodStart/End set, I would like to set its VisiblePeriodStart/End to change to show the whole period.  Once this has been done, however, the user should be able to zoom the RadTimeline as normal.

    The properties for the RadTimeBar and RadTimeline are bound to properties on my ViewModel.  However, what ends up happening is that after changing the PeriodStart/End, my changes to VisiblePeriodStart/End are overridden in TimeBarBase.CoerceVisiblePeriod(), as my calls to set VisiblePeriodStartart/End are being done before the PeriodStart/End DependencyProperty have been properly updated.

    So what ends up happening is that sometimes I get what I want: i.e.VisiblePeriodStart/End being the same as PeriodStart/End, but other times, VisiblePeriodStart/End are set to the PREVIOUS values of PeriodStart/End.

    Is there a proper set of steps that I am missing to make this work?

    Thanks for your help

  2. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 23 May 2013 Link to this post

    Hi James,

    We are aware of this problem. Basically, the correct approach depends on the concrete scenario. That is why, I cannot tell you whether you can achieve the result you want, unless I examine your code.

    On a side note, because of cases like yours, we have made major refactoring of the coercing mechanism in RadTimeline and RadTimeBar. You can test your code with the latest internal build to see if it fixes your problem as well. The fix will also be part of Q2 2013. 

    Regards,
    Tsvetie
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. James
    James avatar
    7 posts
    Member since:
    Jul 2012

    Posted 23 May 2013 Link to this post

    Thanks for getting back to me quickly.  I can live with the current behaviour for now; perhaps the Q2 build will be out before I need to release my application.
  5. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 23 May 2013 Link to this post

    Hi James,

    The official Q2 2013 release is scheduled for the middle of June and we will release a RC in the end of May.

    Regards,
    Tsvetie
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top