Class MessageToolbar
Inherited Members
Namespace: Syncfusion.Blazor.InteractiveChat
Assembly: Syncfusion.Blazor.dll
Syntax
public class MessageToolbar : SfOwningComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Constructors
MessageToolbar()
Declaration
public MessageToolbar()
Properties
ItemClicked
Occurs when a message toolbar item is clicked.
Declaration
[Parameter]
public EventCallback<MessageToolbarItemClickedEventArgs> ItemClicked { get; set; }
Property Value
| Type | Description |
|---|---|
| EventCallback<MessageToolbarItemClickedEventArgs> | An EventCallback<TValue> that handles toolbar item click events. The default value is an empty event callback. |
Remarks
This event is raised whenever a user clicks on any toolbar item within the MessageToolbar. The event provides detailed information about the clicked item through MessageToolbarItemClickedEventArgs.
Use this event to implement custom logic for message actions such as reply, forward, copy, pin, or delete operations.
Examples
Handling toolbar item clicks:
<MessageToolbar ItemClicked="OnToolbarItemClicked">
<MessageToolbarItem IconCss="e-icons e-chat-reply"></MessageToolbarItem>
</MessageToolbar>
@code {
private void OnToolbarItemClicked(MessageToolbarItemClickedEventArgs args)
{
// Handle the toolbar item click
Console.WriteLine($"Clicked item: {args.Item.Text}");
}
}
Width
Gets or sets the width of the message toolbar.
Declaration
[Parameter]
public string Width { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A string representing the CSS width value for the toolbar. The default value is |
Remarks
Accepts any valid CSS width value including percentages (e.g., "100%"), keywords (e.g., "auto"), or fixed pixel values (e.g., "200px").
When set to "auto", the toolbar will automatically size based on its content and available space.
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
| Type | Name | Description |
|---|---|---|
| RenderTreeBuilder | __builder |
Overrides
Dispose(bool)
Dispose unmanaged resources in the Syncfusion Blazor component.
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing | Boolean value to dispose the object. |
Overrides
OnInitializedAsync()
Method invoked when the component is ready to start.
Declaration
protected override Task OnInitializedAsync()
Returns
| Type | Description |
|---|---|
| Task | A System.Threading.Tasks.Task representing any asynchronous operation. |