Method InsertButton
InsertButton(int, string?, string?, SvgImage?, Action?)
Inserts a button into the toolbar at the specified index.
public virtual SimpleToolBarView.IToolBarItem InsertButton(int index, string? text, string? toolTip = null, SvgImage? image = null, Action? onClick = null)
Parameters
indexintThe zero-based index at which the button should be inserted. Must be within the valid range of the toolbar's items.
textstringThe text to display on the button. Can be null if no text is required.
toolTipstringThe tooltip text to display when the user hovers over the button. Can be null if no tooltip is required.
imageSvgImageAn optional SVG image to display on the button. Can be null if no image is required.
onClickActionAn optional action to execute when the button is clicked. Can be null if no action is required.
Returns
- SimpleToolBarView.IToolBarItem
The newly created toolbar button.
Remarks
The method creates a new toolbar button, initializes its properties, and inserts it into the toolbar at the specified index. If the index is out of range, an exception will be thrown.