[Suggestion] OnTrackedItemChanged in PlotModel

Oystein Bjorke 10 lat temu 0
This discussion was imported from CodePlex

ishlasko wrote at 2013-08-22 18:27:

Currently, there's no straightforward way to determine what item is currently being displayed in the tracker. It'd be pretty simple to add a virtual OnTrackedItemChanged method to the PlotModel class, then have the TrackerManipulator trigger it in the Delta and Completed methods.

That way, anyone subclassing the PlotModel could override that, and set properties that could be bound to in other parts of the GUI.

Added this myself locally, but I think others might find it useful if it was in the official build.

(By the way... Big fan of OxyPlot... Been using it professionally for a couple years now... Great library!)

objo wrote at 2013-08-22 21:04:

Good idea! I added a TrackerChanged event on the PlotModel. It also works on windows forms where the tracker is not yet implemented... :)

ishlasko wrote at 2013-08-23 14:52:

Just tried it out in the latest build... Works perfectly, thanks :)

ishlasko wrote at 2013-09-05 23:15:

Found a minor glitch. When you start filtering out items via the IsValidPoint override, the new event starts returning the wrong index/item. Easy fix, though. In XYAxisSeries.GetNearestPointInternal, add an "i++" before the "continue"

objo wrote at 2013-09-06 06:47:

thanks! fixed