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
981 stars 143 forks source link

preventing potential "call base" errors in Conductor #379

Closed Yaevh closed 4 months ago

Yaevh commented 1 year ago

fixes #378

Up until now, when Conductor was activated, it called its ActiveItem's Activate() method from inside the Conductor's OnActivate() virtual method; Deactivate() and Close() worked the same way. If any of those OnXXX() virtual methods of a Conductor were overridden in derived class, and the user code forgot to manually call base method, it would lead to ActiveItem's Activate() method not being called.

This commit moves forwarding Activate calls to Conductor's Activated event; the same goes for Deactivated and Closed. This way the user doesn't have to call the base method when overriding OnActivate(), OnDeactivate and OnClose().

canton7 commented 1 year ago

I don't want to be rude, but I said this was a breaking change in the issue you raised. If you feel differently the right thing to do is to continue the discussion until a consensus is reached, not go ahead with a change anysay.

Yaevh commented 1 year ago

Please excuse me if I acted too hastily, it wasn't my intention to force you in any way; I've pushed this PR only to have some code to link in the discussion of #378. I've explained my reasoning in that issue.