Class SfChip
Represents a Chip control which can be added in a layout and grouped using SfChipGroup. Represents the SfChip class.
Implements
Inherited Members
Namespace: Syncfusion.Maui.Core
Assembly: Syncfusion.Maui.Core.dll
Syntax
public class SfChip : ButtonBase, IDrawableLayout, IDrawable, IAbsoluteLayout, ILayout, IView, IElement, ITransform, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, ISafeAreaView, IPadding, ICrossPlatformLayout, IVisualTreeElement, ISemanticsProvider, ITouchListener, ITextElement, ITapGestureListener, IGestureListener, IParentThemeElement, IThemeElement
Constructors
SfChip()
Initializes a new instance of the SfChip class.
Declaration
public SfChip()
Fields
CloseButtonColorProperty
Gets or sets the value of CloseButtonColor. This property can be used to change the color of the close button. This is a bindable property.
Declaration
public static readonly BindableProperty CloseButtonColorProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
CloseButtonPathProperty
Gets or sets the value of CloseButtonPath. This property can be used to change the path of the close button. This is a bindable property.
Declaration
public static readonly BindableProperty CloseButtonPathProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
SelectionIndicatorColorProperty
Identifies the SelectionIndicatorColor property. This property can be used to set color to the selection indicator.
Declaration
public static readonly BindableProperty SelectionIndicatorColorProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
ShowCloseButtonProperty
Identifies the ShowCloseButton property. This property can be used to set close button by setting this property to true.This is Bindable Property.
Declaration
public static readonly BindableProperty ShowCloseButtonProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
ShowSelectionIndicatorProperty
Identifies the ShowSelectionIndicator property. This property can be used to set whether the selection indicator is visible or not.
Declaration
public static readonly BindableProperty ShowSelectionIndicatorProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Remarks
This Microsoft.Maui.Controls.BindableProperty is read-only.
Properties
CloseButtonColor
Gets or sets the value of CloseButtonColor. This property can be used to change the color of the close button.
Declaration
public Color CloseButtonColor { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Graphics.Color | Specifies the close button color.The default value is Color.FromArgb("#49454E"). |
CloseButtonPath
Gets or sets the value of CloseButtonPath. This property can be used to customize the close button.
Declaration
public string CloseButtonPath { get; set; }
Property Value
Type | Description |
---|---|
System.String | Specifies the close button path.The default value is string.Empty. |
IsSelected
Gets a value indicating whether the SfChip is selected.
Declaration
public bool IsSelected { get; }
Property Value
Type |
---|
System.Boolean |
SelectionIndicatorColor
Gets or sets the value of SelectionIndicatorColor. This property can be used to change the color of the selection Indicator.
Declaration
public Color SelectionIndicatorColor { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Graphics.Color | Specifies the selection indicator color.The default value is Color.FromRgb(30, 25, 43). |
ShowCloseButton
Gets or sets a value indicating whether the close button is visible or not .The close button is in visible state when this property is set to true.
Declaration
public bool ShowCloseButton { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | Specifies the show close button property.The default value is false. |
ShowSelectionIndicator
Gets or sets a value indicating whether the selection indicator is visible or not .The selection indicator is in visible state when this property is set to true.
Declaration
public bool ShowSelectionIndicator { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | Specifies the show selection indicator.The default value is false. |
Methods
ArrangeContent(Rect)
Arrange content method.
Declaration
protected override Size ArrangeContent(Rect bounds)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Maui.Graphics.Rect | bounds |
Returns
Type | Description |
---|---|
Microsoft.Maui.Graphics.Size | the size. |
Overrides
ChangeVisualState()
To change the visual state of the chip control.
Declaration
protected override void ChangeVisualState()
Overrides
MeasureContent(Double, Double)
Measure content method.
Declaration
protected override Size MeasureContent(double widthConstraint, double heightConstraint)
Parameters
Type | Name | Description |
---|---|---|
System.Double | widthConstraint | |
System.Double | heightConstraint |
Returns
Type |
---|
Microsoft.Maui.Graphics.Size |
Overrides
OnDraw(ICanvas, RectF)
Drawing methods of chip control.
Declaration
protected override void OnDraw(ICanvas canvas, RectF dirtyRect)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Maui.Graphics.ICanvas | canvas | The canvas. |
Microsoft.Maui.Graphics.RectF | dirtyRect | The rect |
Overrides
Events
CloseButtonClicked
CloseButton Clicked event handler.
Declaration
public event EventHandler<EventArgs> CloseButtonClicked
Event Type
Type |
---|
System.EventHandler<System.EventArgs> |