canton7 / Stylet

A very lightweight but powerful ViewModel-First MVVM framework for WPF for .NET Framework and .NET Core, inspired by Caliburn.Micro.
MIT License
988 stars 143 forks source link

Nested activation of Conductor.ActiveItem #144

Closed Yaevh closed 4 years ago

Yaevh commented 4 years ago

Up to now, ScreenExtemsions.TryActivate(newItem) was called before Conductor.ActiveItem was set to the new item. This commit moves setting ActiveItem to before TryActivate(newItem) call. This allows for nested activation - that is, a scenario where newItem can "intercept" its activation and force parent Conductor to immediately activate another item inside its OnActivate() override, effectively skipping newItem without displaying it. This basically solves #140 in a simpler manner, without the use of events.

Yaevh commented 4 years ago

@canton7 any chance of reviewing & pulling this? :)

canton7 commented 4 years ago

Apologies, busy week.

I had to merge this manually, since it needs to be merged into develop: 6bc5f646f109b7f98c954432be8963ac874e602e