2
votes

My issue is that I have a few controls (buttons, combo-boxes, hit test visible controls, etc) that are on top of a scrollviewer. Now there is no reason for these controls to consume a pointer wheel changed event, and in checking so they do not. But it seems that when the pointer is over these controls and I attempt to scroll, the scrolling event does not get fired on the scrollviewer (I believe that actual event that is supposed to fire is ViewChanged). Now the buttons and stuff should still handle their regular events, such as PointerPressed, KeyDown, etc. But I want to stop them from consuming the event that would cause the scrollviewer to scroll. Any ideas? Thanks in advance.

This is a quick example of what I'm dealing with:

<Grid>
    <ScrollViewer>
        <StackPanel>
            <!-- Insert any number of things here -->
        </StackPanel>
    </ScrollViewer>

    <Button>Hello World</Button>
</Grid>
1
Can you post a simple xaml example? I tried to reproduce this but when I hover over a button and move the mouse scroll wheel, the scrollviewer properly responds. My page is simple: one scrollviewer that has one stackpanel inside. The stackpanel has 50 buttons inside of it. - chue x

1 Answers

0
votes

Add an event to the controls:

public void UIElement_PointerWheelChanged(object sender, PointerWheelChangedEventArgs e)
{
    e.Handled = false;
}