IBarItemWithImageBase.IconUrl Property
Specifies the URL of the item’s icon.
Namespace: DevExpress.Blazor.Office
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
Declaration
string IconUrl { get; set; }
Property Value
Type | Description |
---|---|
String | The icon’s URL. |
Remarks
DevExpress Blazor components support pre-defined icon sets (such as Iconic or Bootstrap-recommended libraries) and custom icon libraries. Refer to the following topic for more information: Icons.
Use any of the following properties to set an item’s icon:
IconUrl
- Specifies the URL of the item’s icon.
- IconCssClass
- Specifies the CSS class of the item’s icon. The IconCssClass property is not in effect if the
IconUrl
property value differs fromnull
or empty string.
The following code snippet specifies an icon’s URL of a custom Undo/Redo group.
<DxRichEdit BarMode=BarMode.Toolbar
CustomizeToolbar=OnCustomizeToolbar/>
@code {
void OnCustomizeToolbar(IToolbar toolbar) {
BarGroupCollection groups = toolbar.Groups;
groups.Clear();
AddUndoRedoGroup(groups);
//...
}
void AddUndoRedoGroup(BarGroupCollection groups) {
IBarGroup undoRedoGroup = groups.AddCustomGroup();
undoRedoGroup.Text = "Undo/Redo";
undoRedoGroup.IconUrl = "_content/MyProject/images/undo.svg";
IBarItem undoButton = undoRedoGroup.Items.Add(RichEditBarItemNames.Undo);
undoButton.TextDisplayMode = TextDisplayMode.Adaptive;
IBarItem redoButton = undoRedoGroup.Items.Add(RichEditBarItemNames.Redo);
redoButton.TextDisplayMode = TextDisplayMode.Adaptive;
}
}
See Also