简体   繁体   中英

WinRT Controls Over Scrollviewer Consuming Scrolling

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>

Add an event to the controls:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM