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
Support for IDestructilbe in WPF projects #1296
Comments
Subscribe has an overload which has a predicate to control the subscription. Check IsActive on the predicate then it will not fire when view is not active. Subscribe(action, ThreadOption.PublisherThread, false, payload=> IsActive); |
Would still be nice to have |
You can write a custom region behavior to accomplish this in your app. This will most likely not be included in Prism as I cannot assume that when a view is removed from a region that it will not be reused again. |
I've actually decided to include this. If someone is trying to reuse VM's after they have been removed from a Region, then it is the developers responsibility not to "clean them up" or even implement this interface. |
Done! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Package info
Repro steps
Looks like the interface
IDestructible
is only available in XF.I'm looking for a way to unsubscribe from events of objects injected to the VM before the VM needs to get collected/disposed of in WPF.
Is there a different way to achieve this?
*Some event sources aren't IoC ruled and
EventAggregator
is not always a feasible solution.The text was updated successfully, but these errors were encountered: