Visual indication of past and future

Sep 12, 2012 at 5:58 PM


Thank you for an excellent contribution to the community. We need to be able to show a visual idication in the timeline telling if what is inside the viewport is historic or future data. An example would be having a blurred/opaque overlay on historic events, with a distinct line showing current time. The actual visual indication is not as important as the technique to do it.

Do you have any suggestions on how to solve this? Coloring the columns, overlay canvas being moved by InertalScroll, or something completely different?


Bjørnar Sundsbø

Sep 12, 2012 at 9:17 PM

an easy fix, without changing control itself, would be to have separate grid row with 2 rectangles, say one is blue (past) and one red (red). Now, you have Timeline.CurrentDateTime, DateTime.Now, TimeSpanToPixels, PixelsToTimeSpan, to calculate size of blue and red rectangles.

Now, attach your calculator to change of CurrentDateTime (there is an event for it), and also to timer (interval depends on your timeline type, and you probably do not need it for years).

Should work. You can overlap these rectangles with timeline, but I do not think this is a good idea.

Hope it helps.


Sep 12, 2012 at 9:32 PM

Thank you for a quick reply.

Essentially what I was thinking, though I was thinking adding an extra canvas/grid/etc behind the timeline. In TimelineBuilder.FixPositions, add some code to use the same properties and methods you mention, and calculate the width of the canvas with the color (between 0 and 100% of the width of the viewport).