You can get the index of AccordionItem when expanding in Xamarin.Forms SfAccordion.
You can also refer the following article.
C#
You can get the index from the ExpandingAndCollapsingEventArgs of the Expanding event.
namespace AccordionXamarin.Behavior
{
public class Behavior : Behavior<SfAccordion>
{
SfAccordion Accordion;
protected override void OnAttachedTo(SfAccordion bindable)
{
Accordion = bindable;
Accordion.Expanding += Accordion_Expanding;
base.OnAttachedTo(bindable);
}
private void Accordion_Expanding(object sender, ExpandingAndCollapsingEventArgs e)
{
App.Current.MainPage.DisplayAlert("", "AccordionItem expanded at index " + e.Index, "Ok");
}
}
}