views:

9

answers:

1

I set the SelectionMode property to OneOrMore. How i can open all items, when conrol loaded?

A: 

I know ho do it.

private void CheckResultAccordion(IEnumerable<ListSearchResult> results)
        {
            ResultAccordion.ItemsSource = null;
            ResultAccordion.ItemsSource = results;
            ResultAccordion.UpdateLayout();
            OpenAllAccordionItems(results.Count());
            ResultAccordion.Visibility = Visibility.Visible;
        }

private void OpenAllAccordionItems(int count)
        {
            while (count > 1)
            {
                ResultAccordion.SelectedIndex = count - 1;
                count--;
            }
        }
Mikhail