I’m encountering a challenge in .NET MAUI involving passing event arguments to a function in the ViewModel. Specifically, I need to access the LastVisibleItemIndex
property from ItemsViewScrolledEventArgs
triggered by the Scrolled event in a CollectionView
. This property is crucial for my task’s implementation.
<CollectionView.Behaviors>
<toolkit:EventToCommandBehavior
EventName="Scrolled"
Command="{Binding ScrolledCommand}"
CommandParameter="Is There a way to pass it here ?" />
</CollectionView.Behaviors>
I have tried many thing but none of them seem to be working as i tought it would be.
Also i have heard something about AttachedProperties
but this seems to but out of my range of knowledge
Im trying to achive something like that in my viewmodel.
[RelayCommand]
public void OnScrolled(ItemsViewScrolledEventArgs e)
{
//code
}