Class SfAccordion
Represents a collection of collapsed and expanded AccordionItem controls.
Inheritance
Implements
Namespace: Syncfusion.Windows.Controls.Layout
Assembly: Syncfusion.SfAccordion.WPF.dll
Syntax
public class SfAccordion : ItemsControl, IUpdateVisualState, IDisposable
Constructors
SfAccordion()
Initializes a new instance of the SfAccordion class.
Declaration
public SfAccordion()
Fields
AccentBrushProperty
Using a DependencyProperty as the backing store for AccentBrush. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty AccentBrushProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
ContentTemplateProperty
Identifies the ContentTemplate dependency property.
Declaration
public static readonly DependencyProperty ContentTemplateProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
ContentTemplateSelectorProperty
Using a DependencyProperty as the backing store for ContentTemplateSelector. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty ContentTemplateSelectorProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
HeaderTemplateProperty
Using a DependencyProperty as the backing store for HeaderTemplate. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty HeaderTemplateProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
HeaderTemplateSelectorProperty
Using a DependencyProperty as the backing store for HeaderTemplateSelector. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty HeaderTemplateSelectorProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
ItemContainerStyleProperty
Identifies the ItemContainerStyle dependency property.
Declaration
public static readonly DependencyProperty ItemContainerStyleProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
SelectedEvent
Defines an event for the Selection of Items
Declaration
public static readonly RoutedEvent SelectedEvent
Field Value
Type |
---|
System.Windows.RoutedEvent |
SelectedIndexProperty
Identifies the SelectedIndex dependency property.
Declaration
public static readonly DependencyProperty SelectedIndexProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
SelectedIndicesProperty
Identifies the SelectedIndices dependency property.
Declaration
public static readonly DependencyProperty SelectedIndicesProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
SelectedItemProperty
Identifies the SelectedItem dependency property.
Declaration
public static readonly DependencyProperty SelectedItemProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
SelectedItemsProperty
Identifies the SelectedItems dependency property.
Declaration
public static readonly DependencyProperty SelectedItemsProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
SelectionModeProperty
Identifies the SelectionMode dependency property.
Declaration
public static readonly DependencyProperty SelectionModeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Properties
AccentBrush
Gets or sets the accent brush
Declaration
public SolidColorBrush AccentBrush { get; set; }
Property Value
Type |
---|
System.Windows.Media.SolidColorBrush |
ContentTemplate
Gets or sets the DataTemplate used to display the content of each generated AccordionItem.
Declaration
public DataTemplate ContentTemplate { get; set; }
Property Value
Type |
---|
System.Windows.DataTemplate |
Remarks
Either ContentTemplate or ItemTemplate is used. Setting both will result in an exception.
ContentTemplateSelector
Gets or sets the TemplateSelector for the Content
Declaration
public DataTemplateSelector ContentTemplateSelector { get; set; }
Property Value
Type |
---|
System.Windows.Controls.DataTemplateSelector |
HeaderTemplate
Gets or sets the template for the header
Declaration
public DataTemplate HeaderTemplate { get; set; }
Property Value
Type |
---|
System.Windows.DataTemplate |
HeaderTemplateSelector
Gets or sets the TemplateSelector for the header
Declaration
public DataTemplateSelector HeaderTemplateSelector { get; set; }
Property Value
Type |
---|
System.Windows.Controls.DataTemplateSelector |
ItemContainerStyle
Gets or sets the Style that is applied to the container element generated for each item.
Declaration
public Style ItemContainerStyle { get; set; }
Property Value
Type |
---|
System.Windows.Style |
SelectedIndex
Gets or sets the index of the currently selected AccordionItem.
Declaration
public int SelectedIndex { get; set; }
Property Value
Type |
---|
System.Int32 |
SelectedIndices
Gets the indices of the currently selected AccordionItems.
Declaration
public IList<int> SelectedIndices { get; }
Property Value
Type |
---|
System.Collections.Generic.IList<System.Int32> |
SelectedItem
Gets or sets the selected item.
Declaration
public object SelectedItem { get; set; }
Property Value
Type |
---|
System.Object |
Remarks
The default value is null. When multiple items are allowed (IsMaximumOneSelected false), return the first of the selectedItems.
SelectedItems
Gets the selected items.
Declaration
public IList SelectedItems { get; }
Property Value
Type |
---|
System.Collections.IList |
Remarks
Does not allow setting.
SelectionMode
Gets or sets the AccordionSelectionMode used to determine the minimum and maximum selected AccordionItems allowed in the Accordion.
Declaration
public AccordionSelectionMode SelectionMode { get; set; }
Property Value
Type |
---|
AccordionSelectionMode |
Methods
ClearContainerForItemOverride(DependencyObject, Object)
Undoes the effects of the System.Windows.Controls.ItemsControl.PrepareContainerForItemOverride(System.Windows.DependencyObject,System.Object) method.
Declaration
protected override void ClearContainerForItemOverride(DependencyObject element, object item)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | element | The container element. |
System.Object | item | The item that should be cleared. |
Dispose()
Represents dispose method for disposing unwanted objects
Declaration
public void Dispose()
Dispose(Boolean)
To remove all the instance which is used in SfAccordion
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
GetContainerForItemOverride()
Creates or identifies the element that is used to display the given item.
Declaration
protected override DependencyObject GetContainerForItemOverride()
Returns
Type | Description |
---|---|
System.Windows.DependencyObject | The element that is used to display the given item. |
IsItemItsOwnContainerOverride(Object)
Determines if the specified item is (or is eligible to be) its own container.
Declaration
protected override bool IsItemItsOwnContainerOverride(object item)
Parameters
Type | Name | Description |
---|---|---|
System.Object | item | The item to check. |
Returns
Type | Description |
---|---|
System.Boolean | True if the item is (or is eligible to be) its own container; otherwise, false. |
OnApplyTemplate()
Builds the visual tree for the Accordion control when a new template is applied.
Declaration
public override void OnApplyTemplate()
OnGotFocus(RoutedEventArgs)
Provides handling for the GotFocus event.
Declaration
protected override void OnGotFocus(RoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.RoutedEventArgs | e | The data for the event. |
OnItemsChanged(NotifyCollectionChangedEventArgs)
Invoked when the System.Windows.Controls.ItemsControl.Items property changes.
Declaration
protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Specialized.NotifyCollectionChangedEventArgs | e | Information about the change. |
OnLostFocus(RoutedEventArgs)
Provides handling for the LostFocus event.
Declaration
protected override void OnLostFocus(RoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.RoutedEventArgs | e | The data for the event. |
OnMouseEnter(MouseEventArgs)
Occurs when the focus is obtained
Declaration
protected override void OnMouseEnter(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseEventArgs | e |
OnMouseLeave(MouseEventArgs)
Occurs when the focus is lost
Declaration
protected override void OnMouseLeave(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseEventArgs | e |
OnMouseLeftButtonDown(MouseButtonEventArgs)
Occurs when the focus is lost
Declaration
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseButtonEventArgs | e |
OnMouseLeftButtonUp(MouseButtonEventArgs)
Occurs when the focus is obtained
Declaration
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseButtonEventArgs | e |
PrepareContainerForItemOverride(DependencyObject, Object)
Prepares the specified element to display the specified item.
Declaration
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | element | The element used to display the specified item. |
System.Object | item | The item to display. |
SelectAll()
Selects all the AccordionItems in the Accordion control.
Declaration
public void SelectAll()
Remarks
If the Accordion SelectionMode is OneOrMore or ZeroOrMore all AccordionItems would be selected. If the Accordion SelectionMode is One or ZeroOrOne all items would be selected and unselected. Only the last AccordionItem would remain selected.
UnselectAll()
Unselects all the AccordionItems in the Accordion control.
Declaration
public void UnselectAll()
Remarks
If the Accordion SelectionMode is Zero or ZeroOrMore all
AccordionItems would be Unselected. If SelectionMode is One or
OneOrMode than all items would be Unselected and selected. Only the
first AccordionItem would still be selected.
Events
SelectedItemsChanged
Occurs when the SelectedItems collection changes.
Declaration
public event NotifyCollectionChangedEventHandler SelectedItemsChanged
Event Type
Type |
---|
System.Collections.Specialized.NotifyCollectionChangedEventHandler |
SelectionChanged
Occurs when the Syncfusion.UI.Xaml.Controls.Navigation.SfTreeNavigatorItem has changed.
Declaration
public event SelectionChangedEventHandler SelectionChanged
Event Type
Type |
---|
System.Windows.Controls.SelectionChangedEventHandler |