Windows Vista Beta | WinVistaBeta.com - Message | removing UI references to my datasourse, app otherwise grinds to a

September 07, 2008  
Subject: removing UI references to my datasourse, app otherwise grinds to a
Group: microsoft.public.windows.developer.winfx.avalon
Date: 5/13/2008 1:25:47 AM
From: Schwartzberg [Email Address Protection]

Hello,

If i reset a controls DataContext (say to a List<MyClass> of MyClass
objects) would i thereby remove the UI reference to the data source?
And thus permitting the objects of the datasource (a list loaded from
an xml file) to be garbage collected.

My problem is that the UI seems not to release references to large
list datasources (loaded from files) and so things are not garbage
collected, and the memory footprint grows, eventually grinding the app
to a halt.

This is a resonably generic problem, of how to administer UI
references to data, and have these references released when no longer
needed.

As an alternative to databinding i could populate the rows of my
listview or listbox manually. I cant see apriori the advantage to
this as far as removing UI references to my datasource goes.

I would garbage collect just to test whatever technique (implicit or
explicit) i use to remove UI references to my datasource.

reagards,
paul

Back