Pre loader

RolloverModifier RolloverData PropertyChanged

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

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?

  • You must to post comments
0
0

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)
    {
        // ... 
    }
}
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies