Skip to content

Commit 487cc2c

Browse files
Cleanup: revert not needed signature change
1 parent 84c7f99 commit 487cc2c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/MaterialDesignThemes.Wpf/ScrollViewerAssist.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,11 +306,13 @@ IntPtr Hook(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled
306306
}
307307

308308
// This relay is only needed because the UIElement.AddHandler() has strict requirements for the signature of the passed Delegate
309-
static void ScrollViewerOnMouseWheel(object? sender, RoutedEventArgs e) => HandleMouseWheel(sender, (MouseWheelEventArgs)e);
309+
static void ScrollViewerOnMouseWheel(object sender, RoutedEventArgs e) => HandleMouseWheel(sender, (MouseWheelEventArgs)e);
310310

311-
static void HandleMouseWheel(object? sender, MouseWheelEventArgs e)
311+
static void HandleMouseWheel(object sender, MouseWheelEventArgs e)
312312
{
313-
if (sender is not ScrollViewer sv || sv.GetVisualAncestry().Skip(1).FirstOrDefault() is not UIElement parentUiElement)
313+
var scrollViewer = (ScrollViewer)sender;
314+
315+
if (scrollViewer.GetVisualAncestry().Skip(1).FirstOrDefault() is not UIElement parentUiElement)
314316
return;
315317

316318
// Re-raise the mouse wheel event on the visual parent to bubble it upwards

0 commit comments

Comments
 (0)