Is it possible to have 2 or more timelines hooked up to the movement of only one zoombar?
One way to achieve this is to hide the Zoombar from the Timelines and to add a separate Zoombar. You can try:
<UserControl x:Class="SilverlightApplication1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:igTimeline="clr-namespace:Infragistics.Silverlight.Timeline;assembly=Infragistics.Silverlight.DataVisualization.Timeline.v9.2"
xmlns:igControls="clr-namespace:Infragistics.Silverlight.Controls;assembly=Infragistics.Silverlight.DataVisualization.Controls.v9.2"
Width="700" Height="500">
<Grid x:Name="LayoutRoot" Background="White">
<Grid.Resources>
<Style x:Name="ZoombarStyle" TargetType="igControls:XamWebZoombar">
<Setter Property="Visibility" Value="Collapsed" />
</Style>
</Grid.Resources>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="70" />
</Grid.RowDefinitions>
<igTimeline:XamWebTimeline x:Name="Timeline1"
ZoombarStyle="{StaticResource ZoombarStyle}">
</igTimeline:XamWebTimeline>
<igTimeline:XamWebTimeline x:Name="Timeline2"
ZoombarStyle="{StaticResource ZoombarStyle}"
Grid.Row="1">
<igControls:XamWebZoombar x:Name="Zoombar"
Grid.Row="2"
ZoomChanged="Zoombar_ZoomChanged">
</igControls:XamWebZoombar>
</Grid>
</UserControl>
…
private void Zoombar_ZoomChanged(object sender, Infragistics.Silverlight.Controls.ZoomChangedEventArgs e)
{
this.Timeline1.Axis.ScrollPosition = e.NewRange.Scroll;
this.Timeline1.Axis.ScrollScale = e.NewRange.Scale;
this.Timeline2.Axis.ScrollPosition = e.NewRange.Scroll;
this.Timeline2.Axis.ScrollScale = e.NewRange.Scale;
}
Hello. I can not access the zoombar of my Timeline ? Why ?
It used to be as easy as calling the Timeline's Zoombar property.
Please help. I would love to capture the zoom event change arguments ...
regards
Angel Bruzos
Currently, you can't access the Zoombar in the Timeline directly, but you can try using the following code:
public partial class MainPage : UserControl
public MainPage()
InitializeComponent();
private bool Initialized { get; set; }
private XamWebZoombar FindZoombar(DependencyObject parent)
XamWebZoombar zoombar = null;
int count = VisualTreeHelper.GetChildrenCount(parent);
for (int i = 0; i < count; i++)
DependencyObject obj = VisualTreeHelper.GetChild(parent, i);
zoombar = obj as XamWebZoombar;
if (zoombar != null)
return zoombar;
zoombar = FindZoombar(obj);
private void UserControl_LayoutUpdated(object sender, EventArgs e)
if (this.Initialized)
return;
XamWebZoombar zoombar = FindZoombar(this.Timeline);
zoombar.ZoomChanged += new EventHandler<ZoomChangedEventArgs>(zoombar_ZoomChanged);
zoombar.ZoomChanging += new EventHandler<ZoomChangeEventArgs>(zoombar_ZoomChanging);
this.Initialized = true;
private void zoombar_ZoomChanging(object sender, ZoomChangeEventArgs e)
private void zoombar_ZoomChanged(object sender, ZoomChangedEventArgs e)
Thanks for reporting this. We'll try including this in next hotfix.
Thank you.
One last question, and I have tried many things before bugging you, but how do I hide, not the zoombar, but the top part of the Timeline. I want to be able to show a zoombar with the time intervals but not the top part, meaning the pane, thumb , event titles.
If i create just a zoombar, there is no way to make it show a line across it with the time series.
thank you,
best regards
Angel
The Zoombar itself doesn't have labels. The Zoombar has preview area that you need to specify whatever you want to preview. The Timeline creates the labels that you are seeing in its Zoombar.
Hi,
I tried above approach to create a zoombar,but the preview labels are not visible.
Do i need to set any properties to show the labels in the zoombar?
Thanks,
Ashok
You can use the Zoombar to preview something custom with:
<igControls:XamWebZoombar Minimum="0"
Maximum="100"
ZoomChanged="XamWebZoombar_ZoomChanged" ZoomChanging="XamWebZoombar_ZoomChanging">
<igControls:XamWebZoombar.Range>
<igControls:Range Minimum="10" Maximum="20">
</igControls:Range>
</igControls:XamWebZoombar.Range>
<igControls:XamWebZoombar.HorizontalPreviewContent>
<Rectangle Fill="Red" />
</igControls:XamWebZoombar.HorizontalPreviewContent>
The Zoombar works with Minimum and Maximum values. If you want to work with Scale and Scroll, you need to set them with the code after the layout of the control is updated.
I used the above XAML(posted by you on 04-13-2009 4:19 AM ) to display my zoombar. but, i am unable to fetch the zoombar with the above specified code(this is specified by you in this post on 04-08-2009 6:23 AM ) to bind to the Zoomchanged and zoomchanging events.
I want to bind and Zoomchanged and zoomchanging events for the above XAML(posted on 04-13-2009 4:19 AM). Please let me know how to achieve this?
Thanks &Regards
Thank you Teodor. Will provide a demo as soon as I can. Mid May most likely.