Is it an absolute necessity to limit the representation directly not tied to the model?
You can open the model as a property in a virtual machine, and then associate it with your view, thereby not receiving an IMPC subscription from Model
something like:
public class MyViewModel: INotifyPropertyChanged { ... private MyModel _model; public MyModel Model { get { return _model; } set { if (value == _model) return; value = _model; RaisePropertyChanged(() => Model); } } ... }
and in xaml (when MyViewModel is a DataContext ):
<TextBlock Text="{Binding Model.ModelProperty}" />
Update:
Maybe this will help you touch the events of PropertyChanged models in a "weak" way.
IWeakEventListener
Using centralized event scheduling WeakEventManager allows handlers to listen to garbage collected (or manually cleaned), even if the lifetime of the original object goes beyond the listeners.
which is used in
Josh Smith PropertyObserver
This, I hope, will solve your problem requiring an explicit rejection of registration?
Viv
source share