mcpField
S
syncfusion-wpf-accordion

syncfusion-wpf-accordion

github.com/syncfusionDevelopment5160 installsUpdated 1w ago
Repository

About syncfusion-wpf-accordion

A skill for implementing Syncfusion’s SfAccordion in WPF. It covers data-bound sections, expansion rules, selection, templates, styling, and animation.

Key features

  1. 01Create expandable WPF sections
  2. 02Bind items to data collections
  3. 03Configure single or multiple expansion
  4. 04Customize headers and content templates
  5. 05Style expanders and animations

Use cases

  1. 01Build FAQ or settings panels
  2. 02Show categorized content on demand
  3. 03Bind business objects to accordion items

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/syncfusion/wpf-ui-components-skills --skill syncfusion-wpf-accordion

After installing, type/syncfusion-wpf-accordionin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
appearance-and-styling.md
getting-started.md
populating-items.md
selecting-items.md
selection-mode.md

Details

From the project README

Implementing SfAccordion (WPF)

When to Use This Skill

Use this skill when the user needs to:

  • Build collapsible/expandable section UI in WPF
  • Display categorized content with expand-on-demand behavior
  • Create Outlook-style, FAQ-style, or settings-panel accordion layouts
  • Bind a business object collection to an accordion
  • Control how many items can be expanded simultaneously
  • Customize accordion item headers, content, expander buttons, or animation

Component Overview

SfAccordion                          (ItemsControl)
└── SfAccordionItem  (×N)            (HeaderedContentControl)
    ├── Header      — always visible (collapsed & expanded)
    └── Content     — visible only when expanded (IsSelected=true)

Assembly: Syncfusion.SfAccordion.WPF
Namespace: Syncfusion.Windows.Controls.Layout
XAML Schema: http://schemas.syncfusion.com/wpf


Documentation and Navigation Guide

Getting Started

📄 Read: references/getting-started.md

  • Assembly reference and NuGet setup
  • XAML and C# control creation
  • Basic SfAccordionItem with Header and Content
  • Themes with SfSkinManager
Populating Items

📄 Read: references/populating-items.md

  • Declarative items via Items collection
  • Data binding via ItemsSource
  • Model + ViewModel + ObservableCollection
  • DisplayMemberPath for quick headers
  • HeaderTemplate / HeaderTemplateSelector
  • ContentTemplate / ContentTemplateSelector
Selecting Items

📄 Read: references/selecting-items.md

  • SelectedIndex — select by index
  • SelectedItem — select by instance (TwoWay binding)
  • SelectedItems / SelectedIndices — read-only collections
  • IsSelected on individual items
  • SelectAll() / UnselectAll() methods
  • SelectedItemsChanged / SelectionChanged events
Selection Mode

📄 Read: references/selection-mode.md

  • One — exactly one expanded (default)
  • OneOrMore — multiple expanded, at least one required
  • ZeroOrOne — at most one, all can collapse
  • ZeroOrMore — multiple, all can collapse
  • Decision guide: choosing the right mode
Appearance and Styling

📄 Read: references/appearance-and-styling.md

  • AccentBrush — highlight color
  • HeaderTemplate / ContentTemplate
  • AccordionButtonStyle — expander arrow customization
  • ItemContainerStyle — per-item styling
  • Animation enable/disable
  • SfSkinManager themes

Quick Start

xmlns:syncfusion="http://schemas.syncfusion.com/wpf"

<syncfusion:SfAccordion Width="300" Height="200">
    <syncfusion:SfAccordionItem Header="WPF"
                                Content="Essential Studio for WPF"/>
    <syncfusion:SfAccordionItem Header="Silverlight"
                                Content="Essential Studio for Silverlight"/>
    <syncfusion:SfAccordionItem Header="WinRT"
                                Content="Essential Studio for WinRT" IsSelected="True"/>
</syncfusion:SfAccordion>
using Syncfusion.Windows.Controls.Layout;

SfAccordion accordion = new SfAccordion();
accordion.Items.Add(new SfAccordionItem { Header = "WPF",        Content = "Essential Studio for WPF" });
accordion.Items.Add(new SfAccordionItem { Header = "Silverlight", Content = "Essential Studio for Silverlight" });
accordion.Items.Add(new SfAccordionItem { Header = "WinRT",       Content = "Essential Studio for WinRT", IsSelected = true });
this.Content = accordion;

Common Patterns

ScenarioApproach
Multiple sections, one open at a timeSelectionMode="One" (default)
FAQ where multiple can be openSelectionMode="ZeroOrMore"
Data-driven contentItemsSource + HeaderTemplate + ContentTemplate
Highlight active item colorAccentBrush
Custom expander arrowAccordionButtonStyle on SfAccordionItem
Slow expand/collapse animationExpandableContentControl.Percentage in ItemContainerStyle
Track which items are expandedSelectedItemsChanged event

Key Properties

PropertyTypeDescription
SelectionModeAccordionSelectionModeOne / OneOrMore / ZeroOrOne / ZeroOrMore
SelectedIndexintIndex of most recently selected item
SelectedItemobjectInstance of most recently selected item
SelectedItemsread-onlyAll currently selected item instances
SelectedIndicesread-onlyAll currently selected item indices
ItemsSourceIEnumerableData collection binding
HeaderTemplateDataTemplateShared header template for all items
ContentTemplateDataTemplateShared content template for all items
HeaderTemplateSelectorDataTemplateSelectorPer-item header template
ContentTemplateSelectorDataTemplateSelectorPer-item content template
AccentBrushBrushAccent color for item highlight
ItemContainerStyleStyleStyle applied to each SfAccordionItem

SfAccordionItem properties:

PropertyDescription
HeaderAlways-visible item header
ContentVisible when item is expanded
IsSelectedtrue = expanded, false = collapsed
IsLockedRead-only; true when item cannot be collapsed
AccordionButtonStyleStyle for the expander toggle button

Comments

Markdown supported