Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

Event Unsubscription in Prism5

$
0
0

Hello...

We've recently updated to Prism5 (from 4.1), since then we're having a Problem with unsubscription Events.

We're using MVVM for our UI's witch a placed in PrimModules.
Each ViewModel is based on an abstract BaseClass.
This BaseClass implements the IActiveAware interface.
With that we're want to make sure (despite of other things) that only 'active' ViewModel receive certain Events.

Basically  we do this...

public bool IsActive {get { return Active; }set {if (value) { Aggregator.GetEvent<EventX>().Subscribe(this.OnEventX); }else { Aggregator.GetEvent<EventX>().Unsubscribe(this.OnEventX); } } }

Tragically the Event-Unsubscription is ignored completely. With the result that every ViewModel ever activated receives the Event.
Oddly when we unsubscribe the Event some other Time and Place it is working as to be expected.

We're running out of ideas. any help will be appreciated!




Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>