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
index
intThe zero-based index at which the button should be inserted. Must be within the valid range of the toolbar's items.
text
stringThe text to display on the button. Can be null if no text is required.
toolTip
stringThe tooltip text to display when the user hovers over the button. Can be null if no tooltip is required.
image
SvgImageAn optional SVG image to display on the button. Can be null if no image is required.
onClick
ActionAn 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.