Class AccordionItem
Represents an item within the SfAccordion control.
Implements
Namespace: Syncfusion.Maui.Toolkit.Accordion
Assembly: Syncfusion.Maui.Toolkit.dll
Syntax
public class AccordionItem : SfView, IDrawableLayout, IDrawable, IAbsoluteLayout, ILayout, IView, IElement, ITransform, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, ISafeAreaView, IPadding, ICrossPlatformLayout, IVisualTreeElement, ISemanticsProvider, IThemeElement
Constructors
AccordionItem()
Declaration
public AccordionItem()
Fields
ContentProperty
Identifies the Content bindable property.
Declaration
public static readonly BindableProperty ContentProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The ContentProperty determines the content displayed within the control.
HeaderBackgroundProperty
Identifies the HeaderBackground bindable property.
Declaration
public static readonly BindableProperty HeaderBackgroundProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The HeaderBackgroundProperty determines the background appearance of the header.
HeaderIconColorProperty
Identifies the HeaderIconColor bindable property.
Declaration
public static readonly BindableProperty HeaderIconColorProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The HeaderIconColorProperty determines the color of the icon displayed in the header.
HeaderProperty
Identifies the Header bindable property.
Declaration
public static readonly BindableProperty HeaderProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The HeaderProperty determines the appearance of the header.
IsExpandedProperty
Identifies the IsExpanded bindable property.
Declaration
public static readonly BindableProperty IsExpandedProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
The IsExpandedProperty determines whether the control is currently expanded or collapsed.
Properties
Content
Gets or sets the view that represents the content of the AccordionItem.
Declaration
public View Content { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.View | It accepts a Microsoft.Maui.Controls.View. The default value is null. |
Remarks
This property allows you to define the content displayed when the accordion item is expanded.
Examples
Here is an example of how to set the Content property for an AccordionItem:
<syncfusion:AccordionItem.Content>
<Grid Padding="10,10,10,10" BackgroundColor="#FFFFFF">
<Label TextColor="#303030"
Text="Hamburger accompanied with melted cheese. The term itself is a portmanteau of the words cheese and hamburger. The cheese is usually sliced, then added a short time before the hamburger finishes cooking to allow it to melt."
VerticalTextAlignment="Center" />
</Grid>
</syncfusion:AccordionItem.Content>
See Also
Header
Gets or sets the custom view that represents the header of the AccordionItem.
Declaration
public View Header { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.View | A Microsoft.Maui.Controls.View that defines the appearance of the header. The default value is null. |
Remarks
By default, the header of an AccordionItem can be customized to display any view as per the requirement.
Examples
Here is an example of how to set the Header property
<syncfusion:AccordionItem.Header>
<Grid>
<Label TextColor="#495F6E"
Text="Cheese burger"
HeightRequest="50"
VerticalTextAlignment="Center" />
</Grid>
</syncfusion:AccordionItem.Header>
See Also
HeaderBackground
Gets or sets the background color of the header in the AccordionItem.
Declaration
public Brush HeaderBackground { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.Brush | It accepts a Microsoft.Maui.Graphics.Color value. The default value is Color.FromArgb("#00000000"). |
Remarks
This property allows you to customize the color appearance of the accordion header.
Examples
Here is an example of how to set the HeaderBackground property:
<syncfusion:SfAccordion>
<syncfusion:SfAccordion.Items>
<syncfusion:AccordionItem HeaderBackground="LightBlue">
<!-- Header and Content definitions -->
</syncfusion:AccordionItem>
</syncfusion:SfAccordion.Items>
</syncfusion:SfAccordion>
See Also
HeaderIconColor
Gets or sets the color of the header icon in the AccordionItem.
Declaration
public Color HeaderIconColor { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Graphics.Color | It accepts a Microsoft.Maui.Graphics.Color value. The default value is Color.FromArgb("#49454F"). |
Remarks
This property allows you to customize the color of the icon displayed in the header of the accordion item.
Examples
Here is an example of how to set the HeaderIconColor property:
<syncfusion:SfAccordion>
<syncfusion:SfAccordion.Items>
<syncfusion:AccordionItem HeaderIconColor="DarkRed">
<!-- Header and Content definitions -->
</syncfusion:AccordionItem>
</syncfusion:SfAccordion.Items>
</syncfusion:SfAccordion>
See Also
IsExpanded
Gets or sets a value indicating whether the AccordionItem is expanded or collapsed.
Declaration
public bool IsExpanded { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | It accepts System.Boolean. The default value is false. |
Remarks
This property controls the expanded state of the accordion item.
When set to true
, the item's content is shown, and when set to false
, the content is hidden.
Examples
Here is an example of how to set the IsExpanded property:
<syncfusion:SfAccordion>
<syncfusion:SfAccordion.Items>
<syncfusion:AccordionItem IsExpanded="True">
<!-- Header and Content definitions -->
</syncfusion:AccordionItem>
</syncfusion:SfAccordion.Items>
</syncfusion:SfAccordion>
Methods
ChangeVisualState()
Changes the visual state of the current object.
Declaration
protected override void ChangeVisualState()
Remarks
This method overrides the base implementation to update the visual state based on the current state of this object.
OnBindingContextChanged()
Handles the event when the binding context changes for this object.
Declaration
protected override void OnBindingContextChanged()
Overrides
Remarks
This method updates the binding context of the Header and Content properties to match the new binding context of this object.
OnCommonThemeChanged(String, String)
Method invokes at whenever common theme changes.
Declaration
public void OnCommonThemeChanged(string oldTheme, string newTheme)
Parameters
Type | Name | Description |
---|---|---|
System.String | oldTheme | Represents the old theme. |
System.String | newTheme | Represents the new theme. |
OnControlThemeChanged(String, String)
Method invokes when control theme changes.
Declaration
public void OnControlThemeChanged(string oldTheme, string newTheme)
Parameters
Type | Name | Description |
---|---|---|
System.String | oldTheme | Represents the old theme. |
System.String | newTheme | Represents the new theme. |