I’m having some difficulty with the RolloverData PropertyChanged notification. I have attached an event handler based on your code, which is triggered as I mouse over the chart, but the SeriesInfo collection always has a count of 0. The data bound rollover block does update correctly.
Any ideas?
- Alex Lynch asked 14 years ago
- You must login to post comments
Hello Alex,
You’re right – I just looked at the RolloverModifier code and it assigns a new (empty) ObservableCollection before filling it with values.
May I ask, why do you need a notification of rollover? There may be another way to achieve what you want.
It’s a bit messy but the following code should get you a notifcation of new Rollover data
this.rolloverModifier.RolloverData.PropertyChanged += (s, e) =>
{
// Rollover data was changed
if (e.PropertyName == "SeriesInfo")
{
this.rolloverModifier.RolloverData.CollectionChanged += (c, args) =>
{
// SerisInfo was added to the collection
// NOTE: Be careful to unsubscribe to events as this handler will keep the
// ObservableCollection alive on GC
}
}
};
Another way might be to handle the MouseMove events and RenderedEvent on SciChartSurface itself and testing for new RolloverData here. For instance:
this.sciChartSurface.MouseMove += (s, e) => OnMouseMoveOrRendered();
this.sciChartSurface.Rendered += (s, e) => OnMouseMoveOrRendered();
private void OnMouseMoveOrRendered()
{
// Test for rollover data here, which is updated on mouse move
// and on render of new data
if (this.rolloverModifier.RolloverData.SeriesInfo != null)
{
// ...
}
}
- Andrew Burnett-Thompson answered 14 years ago
- You must login to post comments
Please login first to submit.

