How to perform an operation while changing the CarouselItem?

We can perform the operation while changing the CarouselItem using the SelectionChanged event. The SelectionChanged event returns the OldItem and selected NewItem.

<carousel:SfCarousel x:Name="carousel"
                     ItemsSource="{Binding ImageCollection}"
                     ItemHeight="200"
                     ItemWidth="200"
                     SelectionChanged="Carousel_SelectionChanged"/>
private void Carousel_SelectionChanged(object sender, Syncfusion.Maui.Core.Carousel.SelectionChangedEventArgs e)
{
    int count = (sender as SfCarousel).SelectedIndex + 1;
    DisplayAlert("SelectionChanged", "Carousel item:" + count + " has Selected", "Ok");
}