Class MessageToolbar
Inheritance
Namespace: Syncfusion.Blazor.InteractiveChat
Assembly: Syncfusion.Blazor.dll
Syntax
public class MessageToolbar : OwningComponentBase
Constructors
MessageToolbar()
Declaration
public MessageToolbar()
Properties
ItemClicked
Occurs when a message toolbar item is clicked.
Declaration
public EventCallback<MessageToolbarItemClickedEventArgs> ItemClicked { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<MessageToolbarItemClickedEventArgs> | An Microsoft.AspNetCore.Components.EventCallback<> 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
public string Width { get; set; }
Property Value
Type | Description |
---|---|
System.String | A System.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 |
---|---|---|
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder | __builder |
Dispose(Boolean)
Dispose unmanaged resources in the Syncfusion Blazor component.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | Boolean value to dispose the object. |
OnInitializedAsync()
Method invoked when the component is ready to start.
Declaration
protected override Task OnInitializedAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A System.Threading.Tasks.Task representing any asynchronous operation. |