I have an accordion that i am populating data from a viewmodel. How would i expand one accordion from the viewmodel?
As an example, i am populating an accordion with weekly data sunday - saturday, I want to expand the accordion to whatever day today is, say Tuesday.
<accordion:SfAccordion x:Name="accordion"
BindableLayout.ItemsSource="{Binding Info}"
ExpandMode="Single">
<BindableLayout.ItemTemplate>
<DataTemplate>
<accordion:AccordionItem IsExpanded="{Binding IsExpanded}">
<accordion:AccordionItem.Header>
<Grid>
<Label Grid.Row="0"
Text="{Binding Name}"
TextColor="Black"
FontAttributes="Bold"
FontSize="20" />
</Grid>
</accordion:AccordionItem.Header>
<accordion:AccordionItem.Content>
<Grid HeightRequest="50">
<Label Text="{Binding Description}"/>
</Grid>
</accordion:AccordionItem.Content>
</accordion:AccordionItem>
</DataTemplate>
</BindableLayout.ItemTemplate>
</accordion:SfAccordion> |