microsoft / wil

Windows Implementation Library
MIT License
2.58k stars 236 forks source link

`untyped_event` and `typed_event` do not work for events that don't derive from `EventHandler` or `TypedEventHandler` (eg `Windows.UI.Xaml.Data.CurrentChangingEventHandler`) #354

Open citelao opened 1 year ago

citelao commented 1 year ago

untyped_event and typed_event require events that derive from EventHandler or TypedEventHandler respectively. However, there are a fair number of events that do not derive from these classes. For example, PropertyChanged INotifyPropertyChanged (which, admittedly, can be implemented via other WIL helpers) and Windows.UI.Xaml.Data.CurrentChangingEventHandler.

We should support wil::custom_event for events that use custom handlers/delegates.

dunhor commented 1 year ago

This is fixed now, right?

citelao commented 1 year ago

No, I didn't fix this with #352.

We still need to introduce something like wil::custom_event.