Dynamically changing ItemSourceType does not work as expected

Jan 15, 2011 at 8:07 AM

Thanks for help in advance

In our application there are different groups of events to display on timeline. I would like to have different TimelineBand based on different groups of displayed events. The ItemSourceType could be minutes, days, months based on the time span of all the displayed events. So I calculated the time span of all the displayed events and set ItemSourceType dynamically for each events group. But the TimelineBand always displays by months.  For example 'Feb', 'Mar'. It did not display by minutes or days.

I debugged the code. The ItemSourceType of TimelineBand was reset successfully. But value of the timelineBand.Calculator is {Months} and value of timelineBand.Calculator.Calendar.LineType is also 'Months'. And I can not reset this property.

Can you help me for this? Let me know what I should do if I want to display timelineband by months, or minutes or days dynamically based on time span of events. Thanks a lot.

 

 <timeline:TimelineTray             x:Name="timeline"             CalendarType="gregorian"            HorizontalAlignment="Stretch"            VerticalAlignment="Stretch"            InitialDateTime="{Binding InitialDateTime}"            DataContextChanged="Timeline_DataContextChanged"            Grid.Row="1"            > 

           <timeline:TimelineBand x:Name="timelineBand" IsMainBand="True"                                   HorizontalAlignment="Stretch"                                   ItemSourceType="months" TimelineWindowSize="{Binding TimelineWindowSize}"                                   MaxEventHeight="30"                                    DefaultEventTemplate="{StaticResource EventTemplate}"                                   DefaultItemTemplate="{StaticResource ColumnTemplateStyle}"                                   PreviewMouseWheel="TimelineBand_PreviewMouseWheel" PreviewMouseDown="TimelineBand_PreviewMouseDown" MouseDown="TimelineBand_MouseDown" PreviewMouseMove="TimelineBand_PreviewMouseMove" />    

   </timeline:TimelineTray>