Caliburn.Micro icon indicating copy to clipboard operation
Caliburn.Micro copied to clipboard

Added async eventhandler to IActivate

Open KasperSK opened this issue 3 years ago • 4 comments

This fixes #762, and makes it so that ConductWith has the same behavior for Activate and Deactivate.

KasperSK avatar Jun 21 '21 20:06 KasperSK

This will be a breaking change so how you manage this in terms of sem ver will be interesting.

nigel-sampson avatar Jun 21 '21 21:06 nigel-sampson

@nigel-sampson you are right this is a breaking change. Do you think we should have both Activated and ActivatedAsync events? We could mark Activated as obsolete and remove it in a future release.

event AsyncEventHandler<ActivationEventArgs> ActivatedAsync;

[Obsolete]
event EventHandler<ActivationEventArgs> Activated;

vb2ae avatar Jun 22 '21 01:06 vb2ae

It's a tough one, because that style approach means you're left with ActivatedAsync as the name which creates conflict with the other event names which would lead to another round of deprecation / rename.

Another possibility is to hold off on fixing this till the next major version.

nigel-sampson avatar Jun 22 '21 01:06 nigel-sampson

@nigel-sampson I thought about this being breaking, however I also see it as something I should have taken into account when making the change for IDeactivate. Bumping the major version just for this feature would not be right so I guess this will have to wait till we have enough changes to justify 5.0.

KasperSK avatar Jun 22 '21 06:06 KasperSK

Yes @vb2ae, this needs to go in V5 since we where holding back on this change because it was breaking.

KasperSK avatar Feb 03 '23 12:02 KasperSK