views:

15

answers:

0

I have a WPF "wizard" where I am using PageFunction objects to display the various pages in the wizard. Several of these pages use references to objects in other assemblies within the application so the user can select "packages" they want to include in a generated ouput. In the page function, I have the keep alive flag set to true so that when the user presses cancel or finish in the wizard I can capture the wizard results and the corresponding data the user selected.

The problem is that the wizard pages never go away even after the scope in which they were created has been exited, Thus, when I try to remove one of the referenced objects that the wizard was databound to from a collection, it causes the wizard page to throw an exception. I cannot seem to find a way to correct this issue without setting the KeepAlive flag to false, but this breaks the ability to capture the user data from the wizard.

Any ideas?

Thanks!