views:

1157

answers:

3

Does anyone have any good pointers for creating a custom silverlight timeline?! In fact it doesn't even need to be that custom, I have a database table and each object in that table has a datetime field called "CreateDate". I want to use this field to assemble a timeline, showing the other relevant fields at each specific CreateDate point........

Any tips? advice? help? samples?

Cheers

A: 

The only one that I know of is this commercial control from Infragistics.

(I am not affiliated with them)

Magnus Johansson
A: 

Implement your own Timeline Panel. Its quite easy!

Panels allow you to control layout generically for its children. The ItemsControl for example exposes a property called ItemsPanel that is of type ItemsPanelTemplate. By default this ItemsPanelTemplate contains a vertical StackPanel but can be overridden with your awesome Timeline Panel. They key to any timeline is the x-coordinate.

Using the code below to calculate your x coordinate is half the battle. After that its just a matter of determining overlap so you can properly stack your items on the timeline.

The Avanade Silverlight Accelerator has both a Timeline Control and a StackCalendar Control (think Gannt Chart) which work very nicely.

public double ScaleDate(DateTime date)
    {
        TimeSpan span = this.StopDate - this.StartDate;
        TimeSpan pos = date - this.StartDate;

        double posDays = double.Parse(pos.Days.ToString());
        double spanDays = double.Parse(span.Days.ToString());
        double x = posDays / spanDays;

        return x;
    }
markti
A: 

Try this one also timeline.codeplex.com. It is free control under LGPL license.

s.vista