Jacek M
Jacek M

Reputation: 2418

"Cannot be disposed while still in the visual tree" for Bing Maps Control for WPF

When navigating from a WPF page with Bing Maps Control for WPF I get the following exception message: "Cannot be disposed while still in the visual tree".

In my case I use NavigationService.Navigate(URI, UriKind.Relative)

Upvotes: 1

Views: 710

Answers (1)

Jacek M
Jacek M

Reputation: 2418

The solution is to set KeepAlive="True" parameter for the Page object with Bing Maps Control. This way it won't get disposed and will remain in the navigation Journal. This is further explained here: http://msdn.microsoft.com/en-us/library/ms750478.aspx#PageLifetime

Upvotes: 1

Related Questions