Class SfChipGroup
Represents a grouping control which adds SfChips control to a layout and grouped them for selection.
Inheritance
Namespace: Syncfusion.Maui.Core
Assembly: Syncfusion.Maui.Core.dll
Syntax
public class SfChipGroup : ContentView, IParentThemeElement, IThemeElement
Constructors
SfChipGroup()
Initializes a new instance of the SfChipGroup class. This is constructor of the SfChipGroup class.
Declaration
public SfChipGroup()
Fields
ChipBackgroundProperty
Identifies the ChipBackground property. This property can be used to change the background color of the chip in the chip group. This is a bindable property.
Declaration
public static readonly BindableProperty ChipBackgroundProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
ChipCornerRadiusProperty
Gets or sets a value that indicates the selection mode of chip item in the Choice type. This is a bindable property.
Declaration
public static readonly BindableProperty ChipCornerRadiusProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
This property is applicable for Choice only.
ChipFontAttributesProperty
Identifies the ChipFontAttributes property. This property can be used to change the font of text to either bold or italic.
Declaration
public static readonly BindableProperty ChipFontAttributesProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
ChipFontFamilyProperty
Identifies the ChipFontFamily property. This property can be used to change the font family for the chip in the chip group. This is a bindable property.
Declaration
public static readonly BindableProperty ChipFontFamilyProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
ChipImageSizeProperty
Identifies the ChipImageSize property. This property can be used to customize the width and height of the chip image. This is a bindable property.
Declaration
public static readonly BindableProperty ChipImageSizeProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
ChipLayoutProperty
Identifies the ChipLayout property. This property can be used to add all the chips in a chip group. This is a bindable property.
Declaration
public static readonly BindableProperty ChipLayoutProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
ChipPaddingProperty
Identifies the ChipPadding property. This property can be used to set spacing between the chips. This is a bindable property.
Declaration
public static readonly BindableProperty ChipPaddingProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
ChipStrokeProperty
Identifies the ChipStroke property. This property can be used to change the border color of the chip in the chip group. This is a bindable property.
Declaration
public static readonly BindableProperty ChipStrokeProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
ChipStrokeThicknessProperty
Identifies the ChipStrokeThickness property. This property can be used to change the border width of chips. This is bindable property.
Declaration
public static readonly BindableProperty ChipStrokeThicknessProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
ChipTextColorProperty
Identifies the ChipTextColor property. This property can be used to change the text color of the chip in the chip group. This is a bindable property.
Declaration
public static readonly BindableProperty ChipTextColorProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
ChipTextSizeProperty
Identifies the ChipTextSize property. This property can be used to change the text size for the chip in the chip group. This is a bindable property.
Declaration
public static readonly BindableProperty ChipTextSizeProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
ChipTypeProperty
Identifies the Type property. This property can be used to set the type of the chips in the chip group. This is a bindable property.
Declaration
public static readonly BindableProperty ChipTypeProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
ChoiceModeProperty
Gets or sets a value that indicates the selection mode of chip item in the Choice type. This is a bindable property.
Declaration
public static readonly BindableProperty ChoiceModeProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
This property is applicable for Choice only.
CloseButtonColorProperty
Identifies the CloseButtonColor property. Using this property, you can change the color of the close button in chip. This is bindable property.
Declaration
public static readonly BindableProperty CloseButtonColorProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
CommandProperty
Identifies the Command property. This property can be used to set command to the chip group. This is a bindable property.
Declaration
public static readonly BindableProperty CommandProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
DisplayMemberPathProperty
Identifies the DisplayMemberPath property. It is a member path for the display text in chip. This is a bindable property.
Declaration
public static readonly BindableProperty DisplayMemberPathProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
ImageMemberPathProperty
Identifies the ImageMemberPath property. It is a member path for the icon image in chip. This is a bindable property.
Declaration
public static readonly BindableProperty ImageMemberPathProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
InputViewProperty
Identifies the InputView property. This property can be used to set the input view or editor in the Input chip group. This is a bindable property.
Declaration
public static readonly BindableProperty InputViewProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
ItemHeightProperty
Identifies the ItemHeight property. This property can be used to customize the height of the chips in group. This is bindable property.
Declaration
public static readonly BindableProperty ItemHeightProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
ItemsProperty
Identifies the Items property. This property can be used to set items to the chip group. This is a bindable property.
Declaration
public static readonly BindableProperty ItemsProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
ItemsSourceProperty
Identifies the ItemsSource property. This property can be used to set items source for chip group. This is a bindable property.
Declaration
public static readonly BindableProperty ItemsSourceProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
ItemTemplateProperty
Identifies the ItemTemplate property. This property can be used to set custom content to data item in the chip group control. This is a bindable property.
Declaration
public static readonly BindableProperty ItemTemplateProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
SelectedChipBackgroundProperty
Identifies the SelectedChipBackground property. This property can be used to change the background color for the selected chip in the chip group. This is a bindable property.
Declaration
public static readonly BindableProperty SelectedChipBackgroundProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
SelectedChipTextColorProperty
Identifies the SelectedChipTextColor property. This property can be used to change the the text color for the selected chip in the chip group. This is a bindable property.
Declaration
public static readonly BindableProperty SelectedChipTextColorProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
SelectedItemProperty
Identifies the SelectedItem property. This property can be used to select a particular item in the Choice chip group. This is a bindable property.
Declaration
public static readonly BindableProperty SelectedItemProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
SelectionIndicatorColorProperty
Identifies the SelectionIndicatorColor property. Using this property, you can change the color of the selection indicator in chip. This is a bindable property.
Declaration
public static readonly BindableProperty SelectionIndicatorColorProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
ShowIconProperty
Identifies the ShowIcon property. This property indicates whether icon is visible in chip. This is bindable property.
Declaration
public static readonly BindableProperty ShowIconProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Properties
ChipBackground
Gets or sets the value of ChipBackgroundColor. This property can be used to change the background color of the chip in the chip group.
Declaration
public Brush ChipBackground { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.Brush | Specifies the chip background color.The default value is Microsoft.Maui.Graphics.Colors.Transparent. |
ChipCornerRadius
Gets or sets the value of chip corner radius.This property can be used to customize the corners of chip control.
Declaration
public CornerRadius ChipCornerRadius { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.CornerRadius | Specifies the corner radius.The default value is cornerradius(8). |
ChipFontAttributes
Gets or sets the value of ChipFontAttributes. This property can be used to change the font of the chip text in either bold or italic in the chip group.
Declaration
public FontAttributes ChipFontAttributes { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.FontAttributes | Specifies the chip text font attributes.The default value is Microsoft.Maui.Controls.FontAttributes.None. |
ChipFontFamily
Declaration
public string ChipFontFamily { get; set; }
Property Value
Type |
---|
System.String |
ChipImageSize
Gets or sets the value of the ChipImageSize. This property can be used to customize the width and height of the chip image. This is a bindable property.
Declaration
public double ChipImageSize { get; set; }
Property Value
Type | Description |
---|---|
System.Double | Specifies the chip image size. The default value is 26. |
ChipLayout
Gets or sets the value of ChipLayout. This property can be used to add all the chips in a chip group.
Declaration
public Layout ChipLayout { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.Layout | Specifies the chip layout. The default value is null. |
ChipPadding
Gets or sets the value of ChipPadding. This chip padding is used for arranging the items with viewable padding in horizontal orientation.
Declaration
public Thickness ChipPadding { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Thickness | Specifies the chip padding. The default value is Thickness(5d, 0, 0, 0). |
ChipStroke
Gets or sets the value of the ChipStroke. This property can be used to change the border color of the chip in the chip group.
Declaration
public Brush ChipStroke { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.Brush | Specifies the chip stroke color.The default value is Microsoft.Maui.Graphics.Colors.Black. |
ChipStrokeThickness
Gets or sets the value of the ChipStrokeThickness. This property can be used to change the border width of chips. This is a bindable property.
Declaration
public double ChipStrokeThickness { get; set; }
Property Value
Type | Description |
---|---|
System.Double | Specifies the chip border width.The default value is 1d. |
ChipTextColor
Gets or sets the value of ChipTextColor. This property can be used to change the text color of the chip in the chip group.
Declaration
public Color ChipTextColor { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Graphics.Color | Specifies the chip text color.The default value is Microsoft.Maui.Graphics.Colors.Black. |
ChipTextSize
Gets or sets the value of ChipTextSize. This property can be used to change the text size for the chip in the chip group.
Declaration
public double ChipTextSize { get; set; }
Property Value
Type | Description |
---|---|
System.Double | Specifies the chip text size.The default value is 14d. |
ChipType
Gets or sets the value of ChipType. This property can be used to set the type of the chips in the chip group.
Declaration
public SfChipsType ChipType { get; set; }
Property Value
Type | Description |
---|---|
SfChipsType | Specifies the chip type. The default value is Input. |
ChoiceMode
Gets or sets a value that indicates the selection mode of chip item in the Choice type.
Declaration
public ChoiceMode ChoiceMode { get; set; }
Property Value
Type | Description |
---|---|
ChoiceMode | Specifies the choice mode.The default value is Single. |
Remarks
This property is applicable for Choice only.
CloseButtonColor
Gets or sets the value of CloseButtonColor. Using this property, you can change the color of the close button in chip.
Declaration
public Color CloseButtonColor { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Graphics.Color | Specifies the close button color.The default value is Color(107, 107, 107). |
Command
Gets or sets the value of command. This property can be used to give command to chip group.
Declaration
public ICommand Command { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Input.ICommand | Specifies the command.The default value is null. |
DisplayMemberPath
Gets or sets the value of DisplayMemberPath, which is member path value of the display text in chip.
Declaration
public string DisplayMemberPath { get; set; }
Property Value
Type | Description |
---|---|
System.String | Specifies the display member path. The default value is string.Empty. |
ImageMemberPath
Gets or sets the value of ImageMemberPath. It is a member path for icon image of the chip in a chip group.
Declaration
public string ImageMemberPath { get; set; }
Property Value
Type | Description |
---|---|
System.String | Specifies the image member path. The default value is string.Empty. |
InputView
Gets or sets the value of InputView. This property can be used to set input view or editor in the Input Chip group.
Declaration
public View InputView { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.View | Specifies the input view.The default value is null. |
ItemHeight
Gets or sets the value of the ItemHeight. This property can be used to customize the height of the chips in group.
Declaration
public double ItemHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Double | Specifies the height of the item.The default value is System.Double.NaN. |
Items
Gets or sets the value of the ChipCollection. This chip collection of SfChip is used to generate the chips in ChipGroup.
Declaration
public ChipCollection Items { get; set; }
Property Value
Type | Description |
---|---|
ChipCollection | The collection used to populate the chip items. The default is an empty collection. |
ItemsSource
Gets or sets the value of ItemsSource. It is a collection of items to generate the chips in ChipGroup.
Declaration
public IList ItemsSource { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.IList | The collection used to populate the items. The default is null. |
ItemTemplate
Gets or sets the value of ItemTemplate. This property can be used to set custom content for data item in the chip group control.
Declaration
public DataTemplate ItemTemplate { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.DataTemplate | A DataTemplate object that is used to display the custom content. The default is null. |
SelectedChipBackground
Gets or sets a color value that can be used to customize the background color of the selected chips in the chip group.
Declaration
public Brush SelectedChipBackground { get; set; }
Property Value
Type |
---|
Microsoft.Maui.Controls.Brush |
SelectedChipTextColor
Gets or sets a color value that can be used to customize the text color of the selected chips in the chip group.
Declaration
public Color SelectedChipTextColor { get; set; }
Property Value
Type |
---|
Microsoft.Maui.Graphics.Color |
SelectedItem
Gets or sets the value of SelectedItem. This property can be used to select a particular item in the Choice Chip group.
Declaration
public object SelectedItem { get; set; }
Property Value
Type | Description |
---|---|
System.Object | Specifies the selected item.The default value is null. |
SelectionIndicatorColor
Gets or sets the value of SelectionIndicatorColor. Using this property, you can change the color of the selection indicator in chip.
Declaration
public Color SelectionIndicatorColor { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Graphics.Color | Specifies the selection indicator color.The default value is Color(107, 107, 107). |
ShowIcon
Gets or sets a value indicating whether icon is shown in chips. Icon is in the visible state when the ShowIcon property is true, otherwise icons will be collapsed.
Declaration
public bool ShowIcon { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | It specifies the show icon.The default value is false. |
Methods
Dispose()
This method releases all resources used by the SfChipGroup object.
Declaration
public void Dispose()
Remarks
Call Dispose() when you are finished using the SfChipGroup. The Dispose() method leaves the SfChipGroup in an unusable state. After calling Dispose(), you must release all references to the SfChipGroup so the garbage collector can reclaim the memory that the SfChipGroup was occupying.
Dispose(Boolean)
Dispose the specified disposing.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | If set to |
GetChips()
This method returns a read-only collection of chips in SfChipGroup.
Declaration
public ReadOnlyCollection<SfChip> GetChips()
Returns
Type | Description |
---|---|
System.Collections.ObjectModel.ReadOnlyCollection<SfChip> | The children. |
Events
ChipClicked
Raised when the item in SfChips control is tapped.
Declaration
public event EventHandler<EventArgs> ChipClicked
Event Type
Type |
---|
System.EventHandler<System.EventArgs> |
ItemRemoved
Occurs when the user clicked the close button in SfChipGroup.
Declaration
public event EventHandler<SelectionChangedEventArgs> ItemRemoved
Event Type
Type |
---|
System.EventHandler<SelectionChangedEventArgs> |
Remarks
This event support for Input type SfChipGroup only.
SelectionChanged
Occurs when the user selects an item from unselected items.
Declaration
public event EventHandler<SelectionChangedEventArgs> SelectionChanged
Event Type
Type |
---|
System.EventHandler<SelectionChangedEventArgs> |
SelectionChanging
Occurs when the user selects an item from unselected items.
Declaration
public event EventHandler<SelectionChangingEventArgs> SelectionChanging
Event Type
Type |
---|
System.EventHandler<SelectionChangingEventArgs> |