Child elements of scrollviewer preventing scrolling with mouse wheel?

You can also create a behavior and attach it to the parent control (in which the scroll events should bubble through).

// Used on sub-controls of an expander to bubble the mouse wheel scroll event up 
public sealed class BubbleScrollEvent : Behavior<UIElement>
    protected override void OnAttached()
        AssociatedObject.PreviewMouseWheel += AssociatedObject_PreviewMouseWheel;

    protected override void OnDetaching()
        AssociatedObject.PreviewMouseWheel -= AssociatedObject_PreviewMouseWheel;

    void AssociatedObject_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
        e.Handled = true;
        var e2 = new MouseWheelEventArgs(e.MouseDevice, e.Timestamp, e.Delta);
        e2.RoutedEvent = UIElement.MouseWheelEvent;

                <viewsCommon:BubbleScrollEvent />

Leave a Comment