views:

64

answers:

1

For some reason my scrollviewer does not process the mousewheel events (or at least scroll when you mouse wheel) when the mouse is over any child. I want it so that either when the mouse wheel is over the entire scrollviewer area, mousewheel scrolls. Either that or when you click on something contained in the scroller, it processes mouse wheel no matter where the mouse is because it has focus. Is there any easy way to do this?

The basic layout tree goes like so in XAML:

<ScrollViewer x:Name="scroller">
    <StackPanel x:Name="stackPanel" Orientation="Vertical">
        <Expander>
            <WrapPanel />
        </Expander>
        <Expander>
            <WrapPanel />
        </Expander>

    </StackPanel>
</ScrollViewer>
A: 

I figured out the problem. I was actually using a custom WrapPanel that i created, and i forgot that control had its own scrollviewer (invisble since it was set to Auto size). So the wrappanel's scroller was stealing the mousewheel event from the outside scroller. I took out the scroller in the custom wrap panel and everything works normal now.