Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
180
Is it possible to use one zoombar to command two timelines?
posted

Hello,

My client wants to command (navigate in) two timelines using one common zoombar. Is it possible to develop this?

If yes, how can I do please?

Thanks.

Parents
  • 895
    Suggested Answer
    posted

    Hello,

    One way you can achieve this is by binding the ScrollPosition and ScrollScale properties of the Axis of one timeline to another. This way when one of the zoombar changes, the other will change too.

    <ig:XamTimeline x:Name="Timeline1">

    <ig:XamTimeline.Axis>

    <ig:NumericTimeAxis  

      ScrollPosition="{Binding ElementName=Timeline2, Path=Axis.ScrollPosition, Mode=TwoWay}"

      ScrollScale="{Binding ElementName=Timeline2, Path=Axis.ScrollScale, Mode=TwoWay}" />

    </ig:XamTimeline.Axis>

    </ig:XamTimeline>

     

    <ig:XamTimeline x:Name="Timeline2">

    </ig:XamTimeline>

     

    If you want to use an external zoombar this is how it's done:

    <ig:XamTimeline x:Name="Timeline1">

    </ig:XamTimeline>

     

    <ig:XamZoombar

      x:Name="Zoombar"

      ZoomChanged="Zoombar_ZoomChanged"/>

     

    <ig:XamTimeline x:Name="Timeline2">

    </ig:XamTimeline>

     

     

    private void Zoombar_ZoomChanged(object sender, Infragistics.Controls.ZoomChangedEventArgs e)

    {

    Timeline1.Zoombar.Range = e.NewRange;

    Timeline2.Zoombar.Range = e.NewRange;

    }

     

     

     

     You might want to hide the default zoombars of the timelines:

    <Style x:Key="XamZoombarStyle" TargetType="ig:XamZoombar">

    <Setter

      Property="Visibility"

      Value="Collapsed" />

    </Style>

     

    <ig:XamTimeline

      x:Name="Timeline1"

      ZoombarStyle="{StaticResource XamZoombarStyle}"

     

     

     

Reply Children
No Data