The WPF ListView class can be configured to automatically handle scrolling without an external ScrollViewer and allows you to register an event handler for the internal scroll control panel by writing XAML, for example:
<ListView ScrollViewer.ScrollChanged="ScrollChanged" />
How to connect it to the MVVM light command? I tried the following, but it does not work:
<ListView> <i:Interaction.Triggers> <i:EventTrigger EventName="ScrollViewer.ScrollChangedEvent"> <cmd:EventToCommand Command="{Binding ScrollCommand}" /> </i:EventTrigger> </i:Interaction.Triggers> </ListView>
Note: ScrollCommand is a RelayCommand from my view model.
Isens source share