In this topic, you will add an accordion pane to a C1Accordion control in Blend, in XAML, and in code.
At Design Time in Blend
To add a pane to the C1Accordion control, complete the following steps:
1. Click the C1Accordion control once to select it.
2. Under the Assets tab, double-click the C1AccordionItem icon.
An accordion pane is added to the C1Accordion control.
3. Click the C1AccordionItem item once to select it.
4. Under the Properties panel, set the Width property to "150".
In XAML
To add a pane to the C1Accordion control, place the following markup between the <c1:C1Accordion> and </c1:C1Accordion> tags:
<c1:C1AccordionItem Content="C1AccordionItem" Width="150">
</c1:C1AccordionItem>
In Code
To add accordion panes in code, complete the following steps:
1. Add x:Name="C1Accordion1" to the <c1:C1Accordion> tag so that the object will have a unique identifier for you to call in code.
2. Enter Code view and import the following namespace:
Imports C1.Silverlight.Extended
•C#
using C1.Silverlight.Extended;
3. Add the following code beneath the InitializeComponent() method:
'Create the accordion pane and add content
Dim C1AccordionItem1 As New C1AccordionItem()
C1AccordionItem1.Content = "C1AccordionItem1"
C1AccordionItem1.Width = 150
'Add the accordion pane to the C1Accordion control
C1Accordion1.Items.Add(C1AccordionItem1)
•C#
//Create the accordion pane and add content
C1AccordionItem C1AccordionItem1 = new C1AccordionItem();
C1AccordionItem1.Content = "C1AccordionItem1";
C1AccordionItem1.Width = 150;
//Add the accordion pane to the C1Accordion control
C1Accordion1.Items.Add(C1AccordionItem1);
4. Run the program.