The AccordionItem Control

The AccordionItem control displays a header and has a collapsible content window. So, each item in the Accordion control is actually an AccordionItem. Just like the ListBoxItem control works with the ListBox control, the AccordionItem control can work only with the Accordion control. You can also add AccordionItems at design time using Expression Blend to create static Accordion controls with predefined items to your application. You can also apply styles on dynamically created AccordionItems by setting the property ItemTemplate for the Accordion control.

The Header property for the AccordionItem control defines the header of each control. Whereas the Content property defines the content of the control, you can have one or more Content properties at design time using XAML or dynamically set at runtime by using a code-behind.

Figure 7-21 shows how to add AccordionItem to the Accordion control by right-clicking the Accordion control at design time using Blend.

Silveriight.net

Tech noloçjy Opinio n .com

3.......

Cut

Copy

Delete

Align

Auto Size

Group Into

Order

Pin Active Container

Set Current Selection

Bind ItemsSource to Data

| | Add AccordionItem

Make Into UserControL.

Make Into Control-

Edit Control Parts (Template) ►

Edit Other Templates ►

View XAML

Figure 7-21. Adding AccordionItem at design time in Blend

Table 7-16 defines some of the key properties of the AccordionItem control.

Table 7-16. Key Properties of the AccordionItem Control Property Type Description

AccordionButtonStyle Style This property gets or sets the style used by

AccordionButton. This holds the header and an icon.

ExpandDirection ExpandDirection This property gets the direction in which the

AccordionItem content window opens.

IsLocked bool This property gets a value indicating whether the AccordionItem can be selected by the user.

IsSelected bool This property gets or sets a value indicating whether the AccordionItem is selected and its content window is visible.

+3 -3

Average user rating: 3 stars out of 6 votes

Post a comment

  • Receive news updates via email from this site