Class AttachmentRemovingEventArgs
Provides information about the attachment-removing event in the SfAIAssistView component.
Inherited Members
Namespace: Syncfusion.Blazor.InteractiveChat
Assembly: Syncfusion.Blazor.InteractiveChat.dll
Syntax
public class AttachmentRemovingEventArgs : RemovingEventArgs
Remarks
This event argument class is used when an attachment is being removed from the AI Assist View component. It inherits all removal-related information from RemovingEventArgs, including file data, custom form data, request details, and cancellation settings.
Use the Cancel property to prevent the attachment removal operation when specific validation conditions are not met.
Examples
<SfAIAssistView>
<AIAssistViewEvents AttachmentRemoving="OnAttachmentRemoving"></AIAssistViewEvents>
</SfAIAssistView>
@code {
private void OnAttachmentRemoving(AttachmentRemovingEventArgs args)
{
if (args.FilesData?.Count > 0)
{
// Perform custom validation before removal.
args.Cancel = false;
}
}
}
Constructors
AttachmentRemovingEventArgs(RemovingEventArgs)
Initializes a new instance of the AttachmentRemovingEventArgs class using values from the specified RemovingEventArgs instance.
Declaration
public AttachmentRemovingEventArgs(RemovingEventArgs src)
Parameters
| Type | Name | Description |
|---|---|---|
| RemovingEventArgs | src | The source RemovingEventArgs instance whose values are copied to the current object.
If |
Remarks
This constructor creates a wrapper around an existing RemovingEventArgs object, allowing attachment-specific event handling within the SfAIAssistView component.
When src is null, the following defaults are applied:
- Cancel is set to false.
- PostRawFile is set to true.
- Reference-type properties remain null.