I have the problem that CM seems to subscribe twice to PropertyChanged. Or, depending on the POV / expected behavior: It doesn't *unsubscribe* when the item is deactivated.
The scenario is the following:
I have a view model (`OuterViewModel` in the sample) that has a property (`CurrentInnerViewModel`) of another view model (`InnerViewModel`).
Outer has a button. A click on the button cycles through all inner view models it knows, one at a time. When there are no more, it activates the next screen (`NextViewModel`) (see `OuterViewModel.ShowNext`).
Next has a button that simply activates the previous screen.
Now, clicking in fast succession on the "Show next" and "Show previous" buttons with an attached debugger shows that multiple views get created for a single raised PropertyChanged event (see Output pane).
Comments: I created a new simpler version of your sample, including a fix/workaround for the issue (see `OuterViewModel`). Multiple instances of the innermost view are created: * when nesting a `Conductor<T>.Collection.OneActive` inside another one * don't use (disabled) view caching * change the `ActiveItem` in the `OnActivate()` method of the inner conductor I found three possible workarounds: * use view caching (this is on by default) * disable property change notifications in `OnActivate()` method while changing `ActiveItem` * in the outer conductor call `GC.Collect()` before changing `ActiveItem` The last workaround make me believe that the issue might be in WPF...not sure about that. Hope this helps on finding the root cause.
The scenario is the following:
I have a view model (`OuterViewModel` in the sample) that has a property (`CurrentInnerViewModel`) of another view model (`InnerViewModel`).
Outer has a button. A click on the button cycles through all inner view models it knows, one at a time. When there are no more, it activates the next screen (`NextViewModel`) (see `OuterViewModel.ShowNext`).
Next has a button that simply activates the previous screen.
Now, clicking in fast succession on the "Show next" and "Show previous" buttons with an attached debugger shows that multiple views get created for a single raised PropertyChanged event (see Output pane).
Comments: I created a new simpler version of your sample, including a fix/workaround for the issue (see `OuterViewModel`). Multiple instances of the innermost view are created: * when nesting a `Conductor<T>.Collection.OneActive` inside another one * don't use (disabled) view caching * change the `ActiveItem` in the `OnActivate()` method of the inner conductor I found three possible workarounds: * use view caching (this is on by default) * disable property change notifications in `OnActivate()` method while changing `ActiveItem` * in the outer conductor call `GC.Collect()` before changing `ActiveItem` The last workaround make me believe that the issue might be in WPF...not sure about that. Hope this helps on finding the root cause.