Real Time Tooltips

Aug 23, 2011 at 8:13 PM
Edited Aug 23, 2011 at 8:33 PM

First let me start by saying I've been using the DDD for a while now and it's a great tool!  However I am having a very hard time getting real time tooltips on markers of my graphs.  I found this thread that basically describes the exact problem I have been having: 

http://dynamicdatadisplay.codeplex.com/discussions/50842

To summarize, I'm using an ObservableDataSource and want to add tooltips to its points.  However there is no AddMapping(.....) function for an ObservableDataSource.  I tried to overload this datatype but its "mapping" property is private so I can't add the function I want.  The solution in the linked discussion says to use an EnumeratedDataSource and cast it to an ObservableDatasource, but this does not work either(at least I haven't been successful).  Here are some pieces of code I've been trying to implement this with:

foreach (Result result in results) //this is constantly looping to get new results and plot them
                {
                        List<Point> pointList = new List<Point>();
                        test.Add(result.ID, new EnumerableDataSource<Point>(pointList));
 
                        //if the value is a number););
                        if (Double.TryParse(result.Value, out value))
                        {
                            Point resultPoint = new Point(result.Time, value);
                            test[result.ID].SetXMapping(X => resultPoint.X);//test = IDictionary<string, EnumeratedDatasource>
                            test[result.ID].SetYMapping(Y => resultPoint.Y);
                            test[result.ID].AddMapping(ShapeElementPointMarker.ToolTipTextProperty, Y => String.Format("Y Value"));
			}
I don't like this because I'm calling the mapping functions every time another result comes in since I don't know all the results in advance like in the tooltip example.
(Also just to be clear, I know this won't display the data in the tooltip, just trying to get it to display anything). In the solution in the other thread it says
to use:
dispatcher.Invoke(DispatcherPriority.Normal,
new Action(() =>
{
collection.Add(item);
RaiseDataChanged();
})); 

However EnumerableDataSources have no add() method, and also I have no idea what RaiseDataChanged() is supposed to be.
Finally, I try to turn my EnumerableDataSource into an observable one using:
ObservableDataSource<Point> ds = new ObservableDataSource<Point>((IEnumerable<Point>) test[ID]);
                            scatterGraph = plotter.AddLineGraph(ds,
                                                                new Pen(_selectedColor, 0),
                                                                new CirclePointMarker { Size = 7.0, Fill = _selectedColor},
                                                                new PenDescription(ID));
But this also throws an error sayings it's an invalid cast.  If anyone has any ideas/solutions I would appreicate it alot!
Thanks.