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

Binding SelectionStart and SelectionEnd to ViewModel

3 Answers 150 Views
TimeBar
This is a migrated thread and some comments may be shown as answers.
Nick
Top achievements
Rank 1
Nick asked on 25 May 2011, 02:17 AM
I will start by saying that I love the new RadTimeBar control.  It was exactly the sort of control we needed for our app that is currently under development.

As soon as I got the control, the first thing I tried was to bind PeriodStart, PeriodEnd, SelectionStart and SelectionEnd up to my ViewModel.  This hasn't worked very well though.  Binding PeriodEnd and PeriodStart in XAML would work only if I did the bindings in that order (ie: end first and then start).  Unfortunately VisiblePeriodEnd would always equal VisiblePeriodStart which always equalled PeriodStart so the user would have to stretch it out.  After adjusting VisiblePeriodEnd, it would then lock up at PeriodEnd and not be changeable any more.  In the end, I decided to set PeriodStart, PeriodEnd, VisiblePeriodStart and VisiblePeriodEnd to the required values from the ViewModel in the View's DataContextChanged event.  This set everything correctly and enabled the user to then adjust both VisiblePeriodStart and VisiblePeriodEnd.

Anyway, on to my main issue.  I am binding SelectionStart and SelectionEnd in XAML to my ViewModel and it works kinda ok but not really great.  My ViewModel validates the date range selection that the user has asked set using the TimeBar and then stores the validated value instead of the user requested value.  The problem I have is that if the user selects a date range with the TimeBar that when validated results in the same values that are already stored, even though I raise the PropertyChanged events for the properties that SelectionStart and SelectionEnd are bound to, the visual selection on the screen does not update (ie: revert to the previous values that were valid) and instead keeps the user requested values.   I don't see this as as a bug as such as I can see you guys developed the control with it's own validation, but if this is a feature that could be added it would be much appreciated.  For now, as our app is still under development, we are ok with releasing the current functionality to our beta testers as is, but we'd love to have this changed if possible.  In fact, I would love it if I could bind to the ViewModel not just SelectionStart and SelectionEnd but PeriodStart and PeriodEnd as well.

Hope that all made sense =)

Cheers,

Nick Barrett

3 Answers, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 27 May 2011, 03:50 PM
Hello Nick,
We are aware of the problem, when binding PeriodStart and PeriodEnd properties and we will fix it for the upcoming beta release.

Regarding the second problem that you have - I spent some time researching it, and it turns out that the properties of the time bar control have the corrected values and that only the UI of the control is not updated properly. I will log this problem in our data base and we will do our best to fix it for the official Q2 2011 release.

Kind regards,
Tsvetie
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Nick
Top achievements
Rank 1
answered on 29 May 2011, 06:15 AM
Thanks Tsvetie for the reply.  We're looking forward to you guys resolving these.

Do you have issue ID's so that I can track them?

Cheers,

Nick Barrett
0
Tsvetie
Telerik team
answered on 01 Jun 2011, 04:39 PM
Hello Nick,
Regarding the first problem - about binding PeriodStart and PeriodEnd properties, there is no item in the PITS system, but I can tell you that we have already fixed it.

For information on the second problem, please follow this link - http://www.telerik.com/support/pits.aspx#/public/silverlight/6333.

Best wishes,
Tsvetie
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TimeBar
Asked by
Nick
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Nick
Top achievements
Rank 1
Share this question
or