ComponentOne Extended Library for WPF and Silverlight
Adding Text to the Content Area
Accordion > Accordion Task-Based Help > Accordion Pane Content Area > Adding Text to the Content Area

You can easily add a simple line of text to the content area of an accordion pane by setting the Content property to a string in Design view, in XAML, or in code.

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

Note: You can also add text to the content area by adding a TextBox control to the content area and then setting the TextBox control's Text property. To learn how to add a control to the content area, see Adding a Control to the Content Area|document=Documents\C1Extended_Accordion.doc;topic=Adding Content to Content Areas.

At Design Time in Design view

To set the Content property in Design view, complete the following steps:

  1. Click the C1AccordionItem item once to select it.
  2. In the Properties window, set the Content property to a string (for example, "Hello World"). 
  3. Run the program and expand the accordion pane.

In XAML

To set the Content property in XAML, complete the following:

  1. Add Content="Hello World" to the <c1ext:C1AccordionItem> tag so that it appears similar to the following:

    XAML
    Copy Code
    <c1ext:C1AccordionItem Name="C1AccordionItem1" Content="Hello World" Width="150" Height="55">
    

  2. Run the program and expand the accordion pane.

In Code

To set the Content property in code, complete the following steps:

  1. Enter Code view and add the following code beneath the InitializeComponent() method:
    Visual Basic
    Copy Code
    C1AccordionItem1.Content = "Hello World"
    

     

    C#
    Copy Code
    c1AccordionItem1.Content = "Hello World";
    

  2. Run the program and expand the accordion pane.

This Topic Illustrates the Following:

The content of your accordion pane now reads "Hello World". The result of this topic should resemble the following:

 

AddingContenttoContentArea_Final.png