Tom Davies
Tom Davies

Reputation: 2446

Huge memory leaks when changing binding

I've got a wpf app with a pure XAML interface that's databound to various objects in a data model. Essentially, the data model contains of two collections of objects (of the same type). The UI essentially consists of an items control with a complex ItemTemplate to render the objects, whose ItemsSource is either one of the two collections in the model.

The user can toggle which collection is being displayed. Every time this switch happens, the app's memory usage jumps up. I'm doing absolutely nothing other than changing the binding of the Itemscontrol's ItemsSource from one collection to the other.

Would memory leaks be expected in this instance? If so, what do I have to do to stop them?

Upvotes: 0

Views: 992

Answers (1)

Scroog1
Scroog1

Reputation: 3599

One possibility: http://support.microsoft.com/kb/938416/en-us

Are you implementing INotifyPropertyChanged for all classes that are bound to?

Upvotes: 1

Related Questions