Okay. I have a Timeline where I want to read the number and names of the series from a database, then generate the points in each series to be displayed. I can't get any sort of binding to work for the Series.
I also want to change the shape of the points on the timeline.
Are these achievable?
Hi Joe,
From what I can see of the LegendItem, there is nothing provided to it that indicates which series it is associated with aside from the title of the series. We're creating these LegendItems internally and assigning their Content property the title of the NumericTimeSeries or DateTimeSeries as a string. Unfortunately that's all it has to work with.
If your series titles are guaranteed to be unique you could use that as an identifier for your series data and find it that way. Otherwise you may be better off disabling the timeline's legend and providing your own UI for it if the default legend doesn't have enough functionality. You'll still have access to all the series Titles in the XamTimeline's Series collection or you could make it such that the legend binds directly to your series data and uses the information from there instead.
I recommend submitting a new product idea for updating the XamTimeline legend functionality to include some information about what series each LegendItem is associated with to make it a bit easier to retemplate. You can do this here: http://ideas.infragistics.com.
I've gotten the images on my timeline. I want to place the image in the legend, too. I'm templating LegendItem, but can't figure out how to get the image from the SeriesData I've used to populate the series collection.
How do I select the particular instance from the collection that "this LegendItem" represents?
I marked your first answer as the solution. The others have helped clear up confusion that I had on different issues.
I have my points on the timeline, they are using my bitmaps, and are positioned correctly (well, mostly :)).
Unless you object, I'm going to start a new post with the other things that I've yet to resolve (or, maybe I should say, you've yet to resolve, since I haven't done much without your help).
Again, Thanks!
Somewhere we got our wires crossed. I'm not having any issues with event descriptions disappearing. My problem is with what I would call the positioning of the event point. If my event has a time of 49.5 and a duration of 1, the "bubble" is shown on the timeline starting at 50, not centered on 50.
I'll try the Parent on the event point's class.
The timeline does hide certain event descriptions depending on the space available so nothing collides, so it's possible that there isn't enough space in your timeline to display all of them? In my sample, I modified it so that it would alternate series between TopOrLeft and BottomOrRight and I do see some series in both locations (given enough space) so I don't think there's anything special needed there. All I did was set the Position property, nothing else. Can you modify my sample to reproduce your issue and send it back to me so I can take a look at what's going on?
For the EventPoint style, the EventPoint's DataContext is actually your data point so if your image URL is there you can bind directly to it. If the URL is in your own series object contained in the view model then you'll need to access it a different way. You could add a property to your data point called "Parent" which references back to the series object the data point belongs to. Then you could access properties of the series object in the EventPoint.
The TimelineSeriesBinding class / attached properties don't associate the view model series object with the XamTimeline series object and even if it did you wouldn't be able to access the XamTimeline series through the EventPoint as there's no reference to it there. You'd have to bind up the visual tree to the XamTimeline and then access its Series collection. From there you'd have to iterate through the DataSource for each series and see if the EventPoint's DataContext was contained inside in order to determine which XamTimeline series the data point belonged to. This would only work if you had associated the XamTimeline series with the view model one. I think it would be simpler just to add a new property to the data point that references the parent series so you can access the image with a simple binding like this:
(Since the EventPoint's DataContext is already the data point, no binding Source is required)<Image Source="{Binding Path=Parent.EventPointImage}"/>