Skip to content

Conversation

@KristinaKoeva
Copy link

When you have one single WPF Window and its Content is a WebView, you could simulate reloading of the WebView, by disposing the old one and creating a new one. This causes the
OnVisualParentChanged to execute two times, for the old and new WebView. The Window is the same so the following code,
window->LocationChanged += _handler; window->Deactivated += _handler;
executes two times. When the location of the Window changes the handler for the old, disposed view is invoked, which is incorrect and causes exceptions.

@KristinaKoeva
Copy link
Author

Hey,

Unfortunately there are still few cases when Window::GetWindow(oldParent) returns null. The last commit stores the window reference, so that we could use it to unsubscribe from the events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant