Show / Hide Table of Contents

Class Accordion

Represents a collection of collapsed and expanded AccordionItem controls.

Inheritance
System.Object
DependencyObject
UIElement
FrameworkElement
Control
ItemsControl
Accordion
Inherited Members
ItemsControl.Items
ItemsControl.ItemContainerGenerator
ItemsControl.ItemsPanel
ItemsControl.ItemsPanelProperty
ItemsControl.ItemsSource
ItemsControl.ItemsSourceProperty
ItemsControl.ItemTemplate
ItemsControl.ItemTemplateProperty
ItemsControl.DisplayMemberPath
ItemsControl.DisplayMemberPathProperty
ItemsControl.UpdateItemsPanel(ItemsPanelTemplate)
ItemsControl.OnItemsSourceChanged(IEnumerable, IEnumerable)
ItemsControl.LogicalChildren
ItemsControl.GetItemsOwner(DependencyObject)
ItemsControl.ItemsControlFromItemContainer(DependencyObject)
ItemsControl.OnTextInput(TextCompositionEventArgs)
Control.EnableBaseControlHandlingOfVisualStates
Control.ManageIsEnabled(Boolean)
Control.Background
Control.BackgroundProperty
Control.BorderBrush
Control.BorderBrushProperty
Control.BorderThickness
Control.BorderThicknessProperty
Control.FontWeight
Control.FontWeightProperty
Control.FontStyle
Control.FontStyleProperty
Control.Foreground
Control.ForegroundProperty
Control.FontFamily
Control.FontFamilyProperty
Control.FontSize
Control.FontSizeProperty
Control.TextDecorations
Control.TextDecorationsProperty
Control.Padding
Control.PaddingProperty
Control.HorizontalContentAlignment
Control.HorizontalContentAlignmentProperty
Control.VerticalContentAlignment
Control.VerticalContentAlignmentProperty
Control.TabIndex
Control.TabIndexProperty
Control.IsTabStop
Control.IsTabStopProperty
Control.TabNavigation
Control.TabNavigationProperty
Control.Template
Control.TemplateProperty
Control.ApplyTemplate()
Control.GetTemplateChild(String)
Control.Focus()
Control.HandlesScrolling
Control.CreateDomElement(Object, Object)
Control.CharacterSpacingProperty
Control.CharacterSpacing
Control.FontStretchProperty
Control.FontStretch
Control.OnDrop(DragEventArgs)
Control.OnDragEnter(DragEventArgs)
Control.OnDragLeave(DragEventArgs)
Control.OnTextInputUpdate(TextCompositionEventArgs)
Control.MeasureOverride(Size)
Control.ArrangeOverride(Size)
FrameworkElement.LayoutUpdated
FrameworkElement.SizeChanged
FrameworkElement.ResourceLookupMode
FrameworkElement.StyleProperty
FrameworkElement.Style
FrameworkElement.DefaultStyleKeyProperty
FrameworkElement.DefaultStyleKey
FrameworkElement.OverridesDefaultStyleProperty
FrameworkElement.OverridesDefaultStyle
FrameworkElement.OnVisualParentChanged(DependencyObject)
FrameworkElement.VisualChildrenCount
FrameworkElement.GetVisualChild(Int32)
FrameworkElement.Parent
FrameworkElement.AddLogicalChild(Object)
FrameworkElement.RemoveLogicalChild(Object)
FrameworkElement.TemplatedParent
FrameworkElement.Resources
FrameworkElement.IsLoaded
FrameworkElement.SetBinding(DependencyProperty, BindingBase)
FrameworkElement.SetBinding(DependencyProperty, Binding)
FrameworkElement.GetBindingExpression(DependencyProperty)
FrameworkElement.Cursor
FrameworkElement.CursorProperty
FrameworkElement.FindName(String)
FrameworkElement.Name
FrameworkElement.NameProperty
FrameworkElement.DataContext
FrameworkElement.DataContextProperty
FrameworkElement.DataContextChanged
FrameworkElement.Triggers
FrameworkElement.FlowDirectionProperty
FrameworkElement.FlowDirection
FrameworkElement.LanguageProperty
FrameworkElement.Language
FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs)
FrameworkElement.Tag
FrameworkElement.TagProperty
FrameworkElement.LoadedEvent
FrameworkElement.Loaded
FrameworkElement.Unloaded
FrameworkElement.BindingValidationError
FrameworkElement.ContextMenuProperty
FrameworkElement.ContextMenu
FrameworkElement.ContextMenuOpening
FrameworkElement.ToolTipProperty
FrameworkElement.ToolTip
FrameworkElement.INTERNAL_OnDetachedFromVisualTree()
FrameworkElement.INTERNAL_OnAttachedToVisualTree()
FrameworkElement.Height
FrameworkElement.HeightProperty
FrameworkElement.Width
FrameworkElement.WidthProperty
FrameworkElement.HorizontalAlignment
FrameworkElement.HorizontalAlignmentProperty
FrameworkElement.VerticalAlignment
FrameworkElement.VerticalAlignmentProperty
FrameworkElement.Margin
FrameworkElement.MarginProperty
FrameworkElement.MinHeight
FrameworkElement.MinHeightProperty
FrameworkElement.MinWidth
FrameworkElement.MinWidthProperty
FrameworkElement.MaxHeight
FrameworkElement.MaxHeightProperty
FrameworkElement.MaxWidth
FrameworkElement.MaxWidthProperty
FrameworkElement.ActualWidthProperty
FrameworkElement.ActualWidth
FrameworkElement.ActualHeightProperty
FrameworkElement.ActualHeight
UIElement.TransformToVisual(UIElement)
UIElement.RenderSize
UIElement.DesiredSize
UIElement.InvalidateMeasure()
UIElement.InvalidateArrange()
UIElement.Measure(Size)
UIElement.Arrange(Rect)
UIElement.UpdateLayout()
UIElement.DragEnter
UIElement.DragLeave
UIElement.Drop
UIElement.DragOver
UIElement.CacheMode
UIElement.CacheModeProperty
UIElement.Projection
UIElement.ProjectionProperty
UIElement.VisualParent
UIElement.AddVisualChild(UIElement)
UIElement.RemoveVisualChild(UIElement)
UIElement.OnVisualChildrenChanged(DependencyObject, DependencyObject)
UIElement.XamlSourcePath
UIElement.ClipToBounds
UIElement.ClipToBoundsProperty
UIElement.ClipProperty
UIElement.Clip
UIElement.IsEnabledProperty
UIElement.IsEnabled
UIElement.IsEnabledChanged
UIElement.EffectProperty
UIElement.Effect
UIElement.RenderTransformProperty
UIElement.RenderTransform
UIElement.RenderTransformOriginProperty
UIElement.RenderTransformOrigin
UIElement.UseLayoutRounding
UIElement.UseLayoutRoundingProperty
UIElement.Visibility
UIElement.VisibilityProperty
UIElement.IsVisibleProperty
UIElement.IsVisible
UIElement.IsVisibleChanged
UIElement.OpacityProperty
UIElement.Opacity
UIElement.OpacityMaskProperty
UIElement.OpacityMask
UIElement.IsHitTestVisible
UIElement.IsHitTestVisibleProperty
UIElement.AllowDrop
UIElement.AllowDropProperty
UIElement.CaptureMouse()
UIElement.IsMouseCaptured
UIElement.ReleaseMouseCapture()
UIElement.AllowScrollOnTouchMove
UIElement.AllowScrollOnTouchMoveProperty
UIElement.AddHandler(RoutedEvent, Delegate, Boolean)
UIElement.RemoveHandler(RoutedEvent, Delegate)
UIElement.MouseMoveEvent
UIElement.MouseMove
UIElement.OnMouseMove(MouseEventArgs)
UIElement.MouseLeftButtonDownEvent
UIElement.MouseLeftButtonDown
UIElement.MouseRightButtonDownEvent
UIElement.MouseRightButtonDown
UIElement.OnMouseRightButtonDown(MouseButtonEventArgs)
UIElement.MouseWheelEvent
UIElement.MouseWheel
UIElement.OnMouseWheel(MouseWheelEventArgs)
UIElement.MouseLeftButtonUpEvent
UIElement.MouseLeftButtonUp
UIElement.MouseEnterEvent
UIElement.MouseEnter
UIElement.MouseLeaveEvent
UIElement.MouseLeave
UIElement.TextInputStartEvent
UIElement.TextInputStart
UIElement.OnTextInputStart(TextCompositionEventArgs)
UIElement.TextInputEvent
UIElement.TextInput
UIElement.TextInputUpdateEvent
UIElement.TextInputUpdate
UIElement.TappedEvent
UIElement.Tapped
UIElement.OnTapped(TappedRoutedEventArgs)
UIElement.MouseRightButtonUpEvent
UIElement.MouseRightButtonUp
UIElement.OnMouseRightButtonUp(MouseButtonEventArgs)
UIElement.KeyDownEvent
UIElement.KeyDown
UIElement.OnKeyDown(KeyEventArgs)
UIElement.KeyUpEvent
UIElement.KeyUp
UIElement.OnKeyUp(KeyEventArgs)
UIElement.GotFocusEvent
UIElement.GotFocus
UIElement.LostFocusEvent
UIElement.LostFocus
UIElement.LostMouseCapture
UIElement.OnLostMouseCapture(MouseEventArgs)
UIElement.INTERNAL_AttachToDomEvents()
UIElement.INTERNAL_DetachFromDomEvents()
DependencyObject.GetValue(DependencyProperty)
DependencyObject.SetCurrentValue(DependencyProperty, Object)
DependencyObject.ReadLocalValue(DependencyProperty)
DependencyObject.SetValue(DependencyProperty, Object)
DependencyObject.SetValue(DependencyPropertyKey, Object)
DependencyObject.CoerceValue(DependencyProperty)
DependencyObject.Dispatcher
DependencyObject.ClearValue(DependencyProperty)
DependencyObject.ClearValue(DependencyPropertyKey)
DependencyObject.CheckAccess()
DependencyObject.GetAnimationBaseValue(DependencyProperty)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows.Controls
Assembly: OpenSilver.Controls.Layout.Toolkit.dll
Syntax
[StyleTypedProperty(Property = "ItemContainerStyle", StyleTargetType = typeof(AccordionItem))]
[StyleTypedProperty(Property = "AccordionButtonStyle", StyleTargetType = typeof(AccordionButton))]
public class Accordion : ItemsControl, IControl, IFrameworkElement, IUIElement, IDependencyObject

Constructors

| Improve this Doc View Source

Accordion()

Initializes a new instance of the Accordion class.

Declaration
public Accordion()

Fields

| Improve this Doc View Source

AccordionButtonStyleProperty

Identifies the AccordionButtonStyle dependency property.

Declaration
public static readonly DependencyProperty AccordionButtonStyleProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

ContentTemplateProperty

Identifies the ContentTemplate dependency property.

Declaration
public static readonly DependencyProperty ContentTemplateProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

ExpandDirectionProperty

Identifies the ExpandDirection dependency property.

Declaration
public static readonly DependencyProperty ExpandDirectionProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

ItemContainerStyleProperty

Identifies the ItemContainerStyle dependency property.

Declaration
public static readonly DependencyProperty ItemContainerStyleProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

SelectedIndexProperty

Identifies the SelectedIndex dependency property.

Declaration
public static readonly DependencyProperty SelectedIndexProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

SelectedIndicesProperty

Identifies the SelectedIndices dependency property.

Declaration
public static readonly DependencyProperty SelectedIndicesProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

SelectedItemProperty

Identifies the SelectedItem dependency property.

Declaration
public static readonly DependencyProperty SelectedItemProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

SelectedItemsProperty

Identifies the SelectedItems dependency property.

Declaration
public static readonly DependencyProperty SelectedItemsProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

SelectionModeProperty

Identifies the SelectionMode dependency property.

Declaration
public static readonly DependencyProperty SelectionModeProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

SelectionSequenceProperty

Identifies the SelectionSequence dependency property.

Declaration
public static readonly DependencyProperty SelectionSequenceProperty
Field Value
Type Description
DependencyProperty

Properties

| Improve this Doc View Source

AccordionButtonStyle

Gets or sets the Style that is applied to AccordionButton elements in the AccordionItems.

Declaration
public Style AccordionButtonStyle { get; set; }
Property Value
Type Description
Style
| Improve this Doc View Source

ContentTemplate

Gets or sets the DataTemplate used to display the content of each generated AccordionItem.

Declaration
public DataTemplate ContentTemplate { get; set; }
Property Value
Type Description
DataTemplate
Remarks

Either ContentTemplate or ItemTemplate is used. Setting both will result in an exception.

| Improve this Doc View Source

ExpandDirection

Gets or sets the ExpandDirection property of each AccordionItem in the Accordion control and the direction in which the Accordion does layout.

Declaration
public ExpandDirection ExpandDirection { get; set; }
Property Value
Type Description
ExpandDirection
Remarks

Setting the ExpandDirection will set the expand direction on the accordionItems.

| Improve this Doc View Source

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 Description
Style
| Improve this Doc View Source

SelectedIndex

Gets or sets the index of the currently selected AccordionItem.

Declaration
public int SelectedIndex { get; set; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

SelectedIndices

Gets the indices of the currently selected AccordionItems.

Declaration
public IList<int> SelectedIndices { get; }
Property Value
Type Description
System.Collections.Generic.IList<System.Int32>
| Improve this Doc View Source

SelectedItem

Gets or sets the selected item.

Declaration
public object SelectedItem { get; set; }
Property Value
Type Description
System.Object
Remarks

The default value is null. When multiple items are allowed (IsMaximumOneSelected false), return the first of the selectedItems.

| Improve this Doc View Source

SelectedItems

Gets the selected items.

Declaration
public IList SelectedItems { get; }
Property Value
Type Description
System.Collections.IList
Remarks

Does not allow setting.

| Improve this Doc View Source

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 Description
AccordionSelectionMode
| Improve this Doc View Source

SelectionSequence

Gets or sets the SelectionSequence used to determine the order of AccordionItem selection.

Declaration
public SelectionSequence SelectionSequence { get; set; }
Property Value
Type Description
SelectionSequence

Methods

| Improve this Doc View Source

ClearContainerForItemOverride(DependencyObject, Object)

Undoes the effects of the PrepareContainerForItemOverride(DependencyObject, Object) method.

Declaration
protected override void ClearContainerForItemOverride(DependencyObject element, object item)
Parameters
Type Name Description
DependencyObject element

The container element.

System.Object item

The item that should be cleared.

Overrides
ItemsControl.ClearContainerForItemOverride(DependencyObject, Object)
| Improve this Doc View Source

GetContainerForItemOverride()

Creates or identifies the element that is used to display the given item.

Declaration
protected override DependencyObject GetContainerForItemOverride()
Returns
Type Description
DependencyObject

The element that is used to display the given item.

Overrides
ItemsControl.GetContainerForItemOverride()
| Improve this Doc View Source

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.

Overrides
ItemsControl.IsItemItsOwnContainerOverride(Object)
| Improve this Doc View Source

OnApplyTemplate()

Builds the visual tree for the Accordion control when a new template is applied.

Declaration
public override void OnApplyTemplate()
Overrides
Control.OnApplyTemplate()
| Improve this Doc View Source

OnCreateAutomationPeer()

Returns a AccordionAutomationPeer for use by the Silverlight automation infrastructure.

Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
Type Description
AutomationPeer

A AccordionAutomationPeer object for the Accordion.

Overrides
UIElement.OnCreateAutomationPeer()
| Improve this Doc View Source

OnGotFocus(RoutedEventArgs)

Provides handling for the GotFocus event.

Declaration
protected override void OnGotFocus(RoutedEventArgs e)
Parameters
Type Name Description
RoutedEventArgs e

The data for the event.

Overrides
Control.OnGotFocus(RoutedEventArgs)
| Improve this Doc View Source

OnItemsChanged(NotifyCollectionChangedEventArgs)

Invoked when the Items property changes.

Declaration
protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
Parameters
Type Name Description
System.Collections.Specialized.NotifyCollectionChangedEventArgs e

Information about the change.

Overrides
ItemsControl.OnItemsChanged(NotifyCollectionChangedEventArgs)
| Improve this Doc View Source

OnLostFocus(RoutedEventArgs)

Provides handling for the LostFocus event.

Declaration
protected override void OnLostFocus(RoutedEventArgs e)
Parameters
Type Name Description
RoutedEventArgs e

The data for the event.

Overrides
Control.OnLostFocus(RoutedEventArgs)
| Improve this Doc View Source

OnMouseEnter(MouseEventArgs)

Provides handling for the MouseEnter event.

Declaration
protected override void OnMouseEnter(MouseEventArgs e)
Parameters
Type Name Description
MouseEventArgs e

The data for the event.

Overrides
UIElement.OnMouseEnter(MouseEventArgs)
| Improve this Doc View Source

OnMouseLeave(MouseEventArgs)

Provides handling for the MouseLeave event.

Declaration
protected override void OnMouseLeave(MouseEventArgs e)
Parameters
Type Name Description
MouseEventArgs e

The data for the event.

Overrides
UIElement.OnMouseLeave(MouseEventArgs)
| Improve this Doc View Source

OnMouseLeftButtonDown(MouseButtonEventArgs)

Provides handling for the MouseLeftButtonDown event.

Declaration
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
Parameters
Type Name Description
MouseButtonEventArgs e

The data for the event.

Overrides
UIElement.OnMouseLeftButtonDown(MouseButtonEventArgs)
| Improve this Doc View Source

OnMouseLeftButtonUp(MouseButtonEventArgs)

Called before the MouseLeftButtonUp event occurs.

Declaration
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
Parameters
Type Name Description
MouseButtonEventArgs e

The data for the event.

Overrides
UIElement.OnMouseLeftButtonUp(MouseButtonEventArgs)
| Improve this Doc View Source

OnSelectedItemChanged(SelectionChangedEventArgs)

Raises the SelectedItemChanged event when the SelectedItem property value changes.

Declaration
protected virtual void OnSelectedItemChanged(SelectionChangedEventArgs e)
Parameters
Type Name Description
SelectionChangedEventArgs e

The SelectionChangedEventArgs instance containing the event data.

| Improve this Doc View Source

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
DependencyObject element

The element used to display the specified item.

System.Object item

The item to display.

Overrides
ItemsControl.PrepareContainerForItemOverride(DependencyObject, Object)
| Improve this Doc View Source

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.

| Improve this Doc View Source

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

| Improve this Doc View Source

SelectedItemsChanged

Occurs when the SelectedItems collection changes.

Declaration
public event NotifyCollectionChangedEventHandler SelectedItemsChanged
Event Type
Type Description
System.Collections.Specialized.NotifyCollectionChangedEventHandler
| Improve this Doc View Source

SelectionChanged

Occurs when the SelectedItem or SelectedItems property value changes.

Declaration
public event SelectionChangedEventHandler SelectionChanged
Event Type
Type Description
SelectionChangedEventHandler

Extension Methods

DependencyObjectHelper.GetSelfAndAncestors(DependencyObject)
UIElementExtendedRoutedEventExtensions.AddHandler(UIElement, ExtendedRoutedEvent, Delegate, Boolean)
UIElementExtendedRoutedEventExtensions.RemoveHandler(UIElement, ExtendedRoutedEvent, Delegate)
ItemsControlExtensions.GetItemsHost(ItemsControl)
ItemsControlExtensions.GetScrollHost(ItemsControl)
ItemsControlExtensions.GetContainers(ItemsControl)
ItemsControlExtensions.GetContainers<TContainer>(ItemsControl)
ItemsControlExtensions.GetItemsAndContainers(ItemsControl)
ItemsControlExtensions.GetItemsAndContainers<TContainer>(ItemsControl)
VisualTreeExtensions.GetVisualAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestorsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualChildren(DependencyObject)
VisualTreeExtensions.GetVisualChildrenAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualDescendants(DependencyObject)
VisualTreeExtensions.GetVisualDescendantsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualSiblings(DependencyObject)
VisualTreeExtensions.GetVisualSiblingsAndSelf(DependencyObject)
VisualTreeExtensions.GetBoundsRelativeTo(FrameworkElement, UIElement)
VisualTreeExtensions.InvokeOnLayoutUpdated(FrameworkElement, Action)
  • Improve this Doc
  • View Source