Get/Bind to ActualVisiblePeriodStart/End/Range in RadTimeline

3 posts, 0 answers
  1. Ben
    Ben avatar
    2 posts
    Member since:
    Aug 2017

    Posted 04 Aug 2017 Link to this post


    I am currently enjoying the trial of Telerik UI for WPF!

    I've hit an issue which I really need to solve. My interface contains a RadTimeline and a load of other components. I need the other components to adjust in size and position as I scale/slide the range slider at the bottom of the timeline (I believe it's a RadSlider), as though 'linked' to the timeline. 

    To do this, instinctively I would bind to ActualVisiblePeriodRange, ActualVisiblePeriodStart, ActualVisiblePeriodEnd etc. Something like this...

    <telerik:RadTimeline x:Name="RadTimeline1" ActualVisiblePeriodRange="{Binding VisiblePeriodRange, Mode=OneWayToSource}" />

    However, this doesn't seem to work. I am aware that these properties are readonly.


    How can I get the above properties into the View Model so that I can make use of them in other view models? Bear in mind, I don't want to set ActualVisiblePeriodRange/Start/End, I just want to get their values.

    Many thanks in advance!

  2. Ben
    Ben avatar
    2 posts
    Member since:
    Aug 2017

    Posted 04 Aug 2017 in reply to Ben Link to this post

    I should add: I need this to happen in realtime (even though there may be a performance hit!). 

    I am aware that there is another property which will allow this exact behaviour to happen when the user releases the mouse, but I need it to happen whilst dragging. 

  3. Dinko
    Dinko avatar
    1078 posts

    Posted 09 Aug 2017 Link to this post

    Hi Ben,

    An approach which you could try is to subscribe to the ActualVisiblePeriodRangeChanged event and get the ActualVisiblePeriodRange.Start/End properties. If you want to be MVVM you can use the EventToCommandBehavior. Using this behavior you can bind a command from your view model and to the event.

    You can check the attached project which demonstrates this approach. When you change the visible range the command handler will be called in the view model and you can get the start/end property.

    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top