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

Get/Bind to ActualVisiblePeriodStart/End/Range in RadTimeline

2 Answers 66 Views
TimeLine
This is a migrated thread and some comments may be shown as answers.
Ben
Top achievements
Rank 1
Ben asked on 04 Aug 2017, 10:15 AM

Hi, 

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 Answers, 1 is accepted

Sort by
0
Ben
Top achievements
Rank 1
answered on 04 Aug 2017, 10:18 AM

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. 

0
Dinko | Tech Support Engineer
Telerik team
answered on 09 Aug 2017, 08:31 AM
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.

Regards,
Dinko
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 you to write beautiful native mobile apps using a single shared C# codebase.
Tags
TimeLine
Asked by
Ben
Top achievements
Rank 1
Answers by
Ben
Top achievements
Rank 1
Dinko | Tech Support Engineer
Telerik team
Share this question
or