This project is read-only.

Crash when PointsSource binding disappears

Mar 13, 2014 at 4:52 PM
The binding of the PointsSource can become invalid when the window containing the graph is closed. This triggers PointsSourceChanged with PointsSource == null, causing a crash in SeriesBase.cs, GetReflectionValues (source.GetEnumerator() is not allowed with source == null).

I added a test in the topmost if statement to catch this issue:

if (!string.IsNullOrEmpty(path) && source != null)

Our application now works fine again.
Mar 17, 2014 at 5:12 PM
Same problem here. Will this be changed in the next release?
Mar 19, 2014 at 11:43 AM
Fixed by commit 35042
Mar 19, 2014 at 11:44 AM
Thanks much :)
Mar 19, 2014 at 5:57 PM
Edited Mar 19, 2014 at 5:58 PM
I found two other objects that can become invalid in this context in the class AxisBase.

internal void MinValueChnaged(DependencyPropertyChangedEventArgs args), this.MinValue is null if the view is closed (i bound the min an max axis values to a ViewModel property)

The same problem occurs in internal void MaxValueChanged(DependencyPropertyChangedEventArgs args) for this.MaxValue.

I changed the functions to
internal void MinValueChanged(DependencyPropertyChangedEventArgs args)
            if (this.MinValue != null)
internal void MaxValueChanged(DependencyPropertyChangedEventArgs args)
            if (this.MaxValue != null)
Maybe you can commit that here :)
Mar 19, 2014 at 5:59 PM
Hello Foske76, can you take a look at my discussion about customization of axis labels?

I would be grateful
Mar 19, 2014 at 6:03 PM

I think the same could happen in
 internal void IntervalChanged(DependencyPropertyChangedEventArgs args)
            switch (ActualType)
                case ActualType.Double:
                case ActualType.Category:                    
                    if (!this.Interval.ToString().Contains(":"))
So there should also be a check if this.Interval != null