Extended Library for WPF and Silverlight | ComponentOne
Accordion / Accordion Task-Based Help / Accordion Pane Content Area / Adding Multiple Controls to the Content Area
In This Topic
    Adding Multiple Controls to the Content Area
    In This Topic

    You cannot set an accordion pane's (C1AccordionItem) Content property to more than one control at a time. However, you can circumvent this issue by adding a panel-based control that can accept more than one control, such as a StackPanel control, to the content area of the accordion pane. When you add multiple controls to the panel-based control, each one will appear within the accordion pane's content area.

    This topic assumes that you have added a C1Accordion control with at least one C1AccordionItem item to your project.

    To add multiple controls to the content area, complete these steps:

    1. Place the following XAML markup between the <c1ext:C1AccordionItem> and </c1ext:C1AccordionItem> tags:

      

    XAML
    Copy Code
    <c1ext:C1AccordionItem.Content>
                    <StackPanel>
                        <TextBlock Text="1st TextBlock"/>
                        <TextBlock Text="2nd TextBlock"/>
                        <TextBlock Text="3rd TextBlock"/>
                    </StackPanel>
                </c1ext:C1AccordionItem.Content>
    
             

    1. Run the program.
    2. Expand the accordion pane and observe that each of the three TextBlock controls appear in the content area. The result will resemble the following:

     AddingMultipleControls_Final.png