Class SfAccordion
Represents a collection of collapsed and expanded AccordionItem controls.
Inheritance
Implements
Namespace: Syncfusion.UI.Xaml.Controls.Layout
Assembly: Syncfusion.SfAccordion.UWP.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 |
|---|
| Windows.UI.Xaml.DependencyProperty |
ContentTemplateProperty
Identifies the ContentTemplate dependency property.
Declaration
public static readonly DependencyProperty ContentTemplateProperty
Field Value
| Type |
|---|
| Windows.UI.Xaml.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 |
|---|
| Windows.UI.Xaml.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 |
|---|
| Windows.UI.Xaml.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 |
|---|
| Windows.UI.Xaml.DependencyProperty |
ItemContainerStyleProperty
Identifies the ItemContainerStyle dependency property.
Declaration
public static readonly DependencyProperty ItemContainerStyleProperty
Field Value
| Type |
|---|
| Windows.UI.Xaml.DependencyProperty |
SelectedIndexProperty
Identifies the SelectedIndex dependency property.
Declaration
public static readonly DependencyProperty SelectedIndexProperty
Field Value
| Type |
|---|
| Windows.UI.Xaml.DependencyProperty |
SelectedIndicesProperty
Identifies the SelectedIndices dependency property.
Declaration
public static readonly DependencyProperty SelectedIndicesProperty
Field Value
| Type |
|---|
| Windows.UI.Xaml.DependencyProperty |
SelectedItemProperty
Identifies the SelectedItem dependency property.
Declaration
public static readonly DependencyProperty SelectedItemProperty
Field Value
| Type |
|---|
| Windows.UI.Xaml.DependencyProperty |
SelectedItemsProperty
Identifies the SelectedItems dependency property.
Declaration
public static readonly DependencyProperty SelectedItemsProperty
Field Value
| Type |
|---|
| Windows.UI.Xaml.DependencyProperty |
SelectionModeProperty
Identifies the SelectionMode dependency property.
Declaration
public static readonly DependencyProperty SelectionModeProperty
Field Value
| Type |
|---|
| Windows.UI.Xaml.DependencyProperty |
Properties
AccentBrush
Gets or sets the accent brush
Declaration
public SolidColorBrush AccentBrush { get; set; }
Property Value
| Type |
|---|
| Windows.UI.Xaml.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 |
|---|
| Windows.UI.Xaml.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 |
|---|
| Windows.UI.Xaml.Controls.DataTemplateSelector |
HeaderTemplate
Gets or sets the template for the header
Declaration
public DataTemplate HeaderTemplate { get; set; }
Property Value
| Type |
|---|
| Windows.UI.Xaml.DataTemplate |
HeaderTemplateSelector
Gets or sets the TemplateSelector for the header
Declaration
public DataTemplateSelector HeaderTemplateSelector { get; set; }
Property Value
| Type |
|---|
| Windows.UI.Xaml.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 |
|---|
| Windows.UI.Xaml.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 |
|---|---|---|
| Windows.UI.Xaml.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 |
|---|---|
| Windows.UI.Xaml.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
protected override void OnApplyTemplate()
OnGotFocus(RoutedEventArgs)
Provides handling for the GotFocus event.
Declaration
protected override void OnGotFocus(RoutedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| Windows.UI.Xaml.RoutedEventArgs | e | The data for the event. |
OnItemsChanged(Object)
Invoked when the System.Windows.Controls.ItemsControl.Items property changes.
Declaration
protected override void OnItemsChanged(object e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | e | Information about the change. |
OnLostFocus(RoutedEventArgs)
Provides handling for the LostFocus event.
Declaration
protected override void OnLostFocus(RoutedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| Windows.UI.Xaml.RoutedEventArgs | e | The data for the event. |
OnPointerEntered(PointerRoutedEventArgs)
Occurs when the focus is obtained
Declaration
protected override void OnPointerEntered(PointerRoutedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| Windows.UI.Xaml.Input.PointerRoutedEventArgs | e |
OnPointerExited(PointerRoutedEventArgs)
Occurs when the focus is lost
Declaration
protected override void OnPointerExited(PointerRoutedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| Windows.UI.Xaml.Input.PointerRoutedEventArgs | e |
OnPointerPressed(PointerRoutedEventArgs)
Occurs when the focus is lost
Declaration
protected override void OnPointerPressed(PointerRoutedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| Windows.UI.Xaml.Input.PointerRoutedEventArgs | e |
OnPointerReleased(PointerRoutedEventArgs)
Occurs when the focus is obtained
Declaration
protected override void OnPointerReleased(PointerRoutedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| Windows.UI.Xaml.Input.PointerRoutedEventArgs | e |
OnSelectedItemChanged(SelectionChangedEventArgs)
Raises the SelectedItemChanged event when the SelectedItem property value changes.
Declaration
protected virtual void OnSelectedItemChanged(SelectionChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| Windows.UI.Xaml.Controls.SelectionChangedEventArgs | e | The Windows.UI.Xaml.Controls.SelectionChangedEventArgs instance containing the event data. |
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 |
|---|---|---|
| Windows.UI.Xaml.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 SelectedItem or SelectedItems property value changes.
Declaration
public event SelectionChangedEventHandler SelectionChanged
Event Type
| Type |
|---|
| Windows.UI.Xaml.Controls.SelectionChangedEventHandler |