RangeSlider Memory Leak


The RangeSlider has a fairly nasty memory leak when used in a DataTemplate / ItemsControl.ItemsTemplate.
I'm still trying to sort out why.
Will any further updates be made to this library?


BVILLERSJR wrote Feb 26, 2011 at 10:22 PM

        //hook to the size change event of the range slider
        DependencyPropertyDescriptor.FromProperty(ActualWidthProperty, typeof(RangeSlider)).
            AddValueChanged(this, delegate { ReCalculateWidths(); });
The above code is the culprit. This needs to be removed to prevent the memory leak, but where is the appropriate place for the RemoveValueChanged? Presumably, at some point, we would check o see if the control is IsDataBound and remove the event notification?

wrote Feb 14, 2013 at 7:48 PM