Hi,
How can I set up the XamZoombar to be used as a date selector? If that's possible, will I then be able to change the "Unittype" in the code behind?
In fact after a bit more digging, I'd like something akin to the finance showcase example but I'd like to be able to select dates, which should be displayed in the zoom bar, instead.
David
The Zoombar doesn’t display dates itself. The Zoombar labels come from the Timeline. I prepared a sample that the upper part of the Timeline is hidden and only the Zoombar is visible. Try using this code:
<UserControl x:Class="Samples.TimelineCompare"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Width="800" Height="300"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ig="http://schemas.infragistics.com/xaml">
<Grid x:Name="LayoutRoot">
<Grid.Resources>
<Style x:Key="LegendStyle" TargetType="ig:TimelineLegend">
<Setter Property="Visibility" Value="Collapsed" />
</Style>
<Style x:Key="SceneStyle" TargetType="ig:Scene">
<Setter Property="Opacity" Value="0" />
</Grid.Resources>
<ig:XamTimeline LegendStyle="{StaticResource LegendStyle}"
SceneStyle="{StaticResource SceneStyle}"
Background="Transparent"
BorderThickness="0"
MinHeight="70"
Height="90">
<ig:XamTimeline.Axis>
<ig:DateTimeAxis Minimum="01/01/2000"
Maximum="01/01/2001"
AutoRange="False" />
</ig:XamTimeline.Axis>
</ig:XamTimeline>
</Grid>
</UserControl>
You are able to change the Timeline axis unit type in the code behind.
According to above post, I have tried to bind Minimum and Maximum property with my ViewModel. but it throws exception "Object Reference Not set to an Instance of an object". if I give this property with hardcoded values as mentioned above, it works perfectly, but after giving hard coded values if I set UnitType from code behind same object refrence error comes. Below is the code snippet which I tried for your reference please.
"<ig:DateTimeAxis ScrollPosition="0.55" ScrollScale=".45" Minimum="01/01/2010" Maximum="01/01/2011" AutoRange="False" x:Name="DateTimeAxis"/>" was written in Xaml file and
DateTimeAxis.UnitType = DateTimeUnitType.Hours; was written in Xaml.cs file
Please let me know if I have done any mistake here, or please provide me solution for the same.
Hi thanks for that. Tried it and it worked. I'll probably come back later to ask how to customise the items but so far so good.
Regards,