My MainPage in Silverlight has one Frame, and inside it I can show the content of any of several Pages, navigating between them. All Pages have the NavigationCacheMode=”Required” property assignment, so all of them are cached by the Navigation gear.
If the Navigation system caches the instance of every Page that I navigate to, that means that it stores those instances in some kind of list, or collection. How can I access that collection of references to already instantiated Pages?
My goal, simplified: Assuming that I have already navigated to Pages A and B, I want to access controls on Page B from Page A.
Thank you.
The cache required pages are maintained but the
NavigationServicein a private dictionary. No public access to the contents of the dictionary is provided.If you really want to do this then you could manage this yourself with Load and Unload events of the pages being used to add/remove the pages instances in some public static dictionary.
However I would suggest that is not a good design pattern to have one page directly manipulate controls of another. Better would be to create a public static class through which the pages may communicate without actually being aware of each other.