Original User: OraKLE
I have a frame that navigates between two Pages: A and B. Page B contains a contentpresenter whose content is data bound to a Map component property on a singleton viewmodel. The map renders well when navigating to page B. However, an exception is thrown when navigating away from page B.
Code: 4004
System.ArgumentException: value does not fall within expected range.
I tried setting the NavigationCacheMode="Required" on both page A+B. The frame that does the navigation has JournalOwnership="OwnsJournal" set.
I tried declaring the Map component xaml in Page B, then data binding to the Layers property with a collection of layers on the viewmodel but this gives me a different error: Element is already a child of another element.
I tried adding a Map component in code behind of page B in the overridden OnNavigatedTo(NavigationEventArgs e) function, then removing it in OnNavigatedFrom(NavigationEventArgs e), but this still gives me the same exception.
Would anyone kindly advise me on how to use the Map component in an sdk:Frame pagination scenario?