diff --git a/misc/wpf/class-handlers.md b/misc/wpf/class-handlers.md index df67004..71e5fe1 100644 --- a/misc/wpf/class-handlers.md +++ b/misc/wpf/class-handlers.md @@ -20,15 +20,15 @@ private static void HandleMyEvent(object sender, RoutedEventArgs e) ```csharp static MyControl() { - MyEvent.AddClassHandler(x => x.HandleMyEvent); + MyEvent.AddClassHandler((x, e) => x.HandleMyEvent(e)); } -private void HandleMyEvent(object sender, RoutedEventArgs e) +private void HandleMyEvent(RoutedEventArgs e) { } ``` {% endtab %} {% endtabs %} -Notice that in WPF you have to add the class handler as a static method, whereas in Avalonia the class handler is not static: the notification is automatically directed to the correct instance. +Notice that in WPF you have to add the class handler as a static method, whereas in Avalonia the class handler is not static: the notification is automatically directed to the correct instance. The `sender` parameter typical of event handlers is not necessary in this case and everything remains strongly typed.