PageFunction placing cached data in a textblock when going back RRS feed

  • Question

  • I had to report this to somewhere this doesn't seem like this should be happening and while I'ved fixed the problem, I'd like to know why it happened at all.


    I'm using a Frame control to build a wizard and nesting up several controls inside PageFunctions for the layout of each page so that common elements can be shared.


    The tree of controls is roughtly like this:


    Window > ...layout... > Frame > PageFunction > Shared 'WizardPageBase' UserControl > ...layout... > NewWorldDetailsControls UserControl


    The Page Title, Page Description, Next/Cancel Button properties and page colours are bound on to WizardPageBase Dependency properties on the UserControl its self. The textboxes and other controls are on the NewWorldDetailsControls UserControl which is placed inside the WizardPageBase via code, not XAML at creation time of the PageFunction so they can be shared in to other wizards and pages.


    After entering data, one clicks next to go to the next page, then using the standard NavigationService.GoBack() method I can move backward. However data entered by the user in to one of the textboxes is copied somehow to the page description! I haven't even written any code to store the data anywhere yet so I have no idea how this is happening. It finally stopped when I added 'KeepAlive=True' to the PageFunction's tag.


    Below are links to screenshots.


    Starting state


    Returning to the page


    Why did this happen in the first place? Why did KeepAlive stop it happening?

    Can provide code snippets if requested.
    Wednesday, August 1, 2007 6:45 AM