Release v1.6.0
- BPZ does routed events!
Similar to dependency properties, routed events will be registered & implemented when static read-only fields are setup correctly.
The type of the event handler & the routing strategy can be specified if necessary (see readme for more details).
Write this, not that:
// 👩💻 👍 Write this (using BPZ):
public static readonly RoutedEvent SeasonChangedEvent = Gen.SeasonChanged<string>();
// 👩💻 👎 Not that (idiomatic implementation):
public static readonly RoutedEvent SeasonChangedEvent = EventManager.RegisterRoutedEvent(nameof(SeasonChanged), RoutingStrategy.Direct, typeof(RoutedPropertyChangedEventHandler<string>), typeof(MyClass));
public event RoutedPropertyChangedEventHandler<string> SeasonChanged
{
add => this.AddHandler(FooChangedEvent, value);
remove => this.RemoveHandler(FooChangedEvent, value);
}