ScrollViewer mouse wheel not scrolling ScrollViewer mouse wheel not scrolling wpf wpf

ScrollViewer mouse wheel not scrolling


This may help you..

private void ListViewScrollViewer_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e){   ScrollViewer scv = (ScrollViewer)sender;   scv.ScrollToVerticalOffset(scv.VerticalOffset - e.Delta);   e.Handled = true; }


This would probably be the most comfortable solution:

<ListView.Template>    <ControlTemplate>        <ScrollViewer>            <ItemsPresenter></ItemsPresenter>         </ScrollViewer>    </ControlTemplate></ListView.Template>


For me this worked:

<ListView.Template>    <ControlTemplate>        <!-- Empty template to allow ScrollViewer to capture mouse scroll -->        <ItemsPresenter />    </ControlTemplate></ListView.Template>

instead of this:

<ListView.Template>    <ControlTemplate>        <ScrollViewer>            <ItemsPresenter></ItemsPresenter>        </ScrollViewer>    </ControlTemplate></ListView.Template>