I am getting a massive memory leak when I remove and replace line graphs from a ChartPlotter Object. I have narrowed it down realised that when I am using the:
within my user control it is removing the line but not from the private member plotter.addedVisualElements is not decreasing. I have looked at an example from a previous discussion:
with a extension to the plotter class that allows binding. I have edited this so that it adds and removes line and this doesn't leak memory. I have checked how this removes lines and it uses the same:
however, this causes plotter.addedVisualElements to decrease the same as plotter.Children. I have stuggled to implement the example with the binding directly in my code. Any ideas why my code is leaking whereas this example doesn't?