-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix WPF View deactivation #2793
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thanks, I'll see if I can merge this in tonight for you. Just noticed the CI server had a software change so need to adapt. Thanks for the contribution. |
|
I have been doing some additional tests with the updated library and just adding an observable base on the When a However, any |
This tests that both the window and the child control are deactivated when the application is shut down.
When an application is shutdown the Unloaded events are not fired. Windows have the Closed event that can be used to know that the view should be deactivated. User controls do not have a Closing event so the dispatcher's ShutdownStarted event has to be used instead.
|
Yeah relying on the |
DistinctUntilChanged is already called on the merged observables.
src/ReactiveUI.Tests/Platforms/wpf/WpfActivationForViewFetcherTest.cs
Outdated
Show resolved
Hide resolved
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
What kind of change does this PR introduce?
Bug fix.
What is the current behavior?
When a WPF application is shutdown, the
Unloadedevent is not fired and, as a result, theViewis not deactivated byReactiveUI; as explained in the issue #2490.What is the new behavior?
The
ActivationForViewFetcherwill observe theClosingevent (if theViewis aWindow) to determine if theViewshould be deactivated.What might this PR break?
Nothing.
Please check if the PR fulfills these requirements