Hi,
I'm using a SfAccordionControl with ItemSource bound to an ObservableCollection called SelectedDocuments on my view model. The accordion is defined as follows:
<sfLayout:SfAccordion
ItemsSource="{Binding SelectedDocuments}"
AccentBrush="{StaticResource CGIBeet}"
VerticalContentAlignment="Stretch"
VerticalAlignment="Stretch"
SelectionMode="One"
>
When the page first loads the ObservableCollection is empty so the accordion control is not rendered. When the user selects items from a grid on the left side of the page, the items are added to the ObservableCollection and the accordion control is rendered. I have this working correctly with no issues.
However, I am trying to achieve the following requirement:
I need the accordion control to automatically display the last item that was added to the ObservableCollection on the ViewModel. For example, if the ObservableCollection is empty and an item is added to it, I need the accordion control to fully open the item, not just show the header row with the content collapsed. Every time an item is added to the ObservableCollection, I want all exisiting items in the accordion control to collapse and the newest item to be displayed (fully open so you can see the contents).
I'd be grateful if you could provide an example of how to achieve this requirement.
Regards,
Andrew