MindFusion.Wpf Pack Programmer's Guide
Accordion Class
Remarks See Also
 





Represents a container of elements. The elements in the Accordion can be expanded or collapsed.

Namespace: MindFusion.UI.Wpf
Assembly: MindFusion.UI.Wpf

 Syntax

C#  Copy Code

public class Accordion : ItemsControl

Visual Basic  Copy Code

Public Class Accordion
    Inherits ItemsControl

 Remarks

Accordion is an ItemsControl, which means it can contain a collection of objects of any type (such as string, image, or panel). The items in the Accordion control can be expanded and collapsed. The AllowMultipleExpands property determines whether more than one item can be expanded at a time. The items in the Accordion control can display a header. To associate a header with an accordion item, use the Header attached property of the Accordion class.

 Example

The following code illustrates an Accordion control defined in XAML:

XAML  Copy Code

<ui:Accordion>
  <TextBlock Text="Hello world!" ui:Accordion.Header="A TextBlock as an item" />
  <ui:AccordionItem Header="A common accordion item">
    <ListBox>
      <ListBoxItem Content="Item #1" />
      <ListBoxItem Content="Item #2" />
      <ListBoxItem Content="Item #3" />
    </ListBox>
  </ui:AccordionItem>
  <ui:AccordionItem Header="An item with customized header" IsExpanded="True">
    <ui:AccordionItem.HeaderTemplate>
      <DataTemplate>
        <Border BorderBrush="Red" BorderThickness="1">
          <TextBlock Text="{Binding}" />
        </Border>
      </DataTemplate>
    </ui:AccordionItem.HeaderTemplate>
    <StackPanel Orientation="Vertical">
      <RadioButton Content="Circle" />
      <RadioButton Content="Rectangle" IsChecked="True" />
      <RadioButton Content="Triangle" />
    </StackPanel>
  </ui:AccordionItem>
</ui:Accordion>

The image below displays the result:

 Inheritance Hierarchy

System.Object
    System.Windows.Threading.DispatcherObject
        System.Windows.DependencyObject
            System.Windows.Media.Visual
                System.Windows.UIElement
                    System.Windows.FrameworkElement
                        System.Windows.Controls.Control
                            System.Windows.Controls.ItemsControl
                                MindFusion.UI.Wpf.Accordion

 See Also

Accordion Members
MindFusion.UI.Wpf Namespace