menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class BeforeCloseEventArgs - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class BeforeCloseEventArgs

    Provides arguments for the OnClose event, which is triggered before the dialog closes.

    Inheritance
    System.Object
    BeforeCloseEventArgs
    Namespace: Syncfusion.Blazor.Popups
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class BeforeCloseEventArgs : Object
    Remarks

    This event can be used to perform actions or validations before the dialog is closed. The closing process can be canceled by setting the Cancel property to true.

    Constructors

    BeforeCloseEventArgs()

    Declaration
    public BeforeCloseEventArgs()

    Properties

    Cancel

    Gets or sets a value indicating whether the closing of the dialog should be canceled.

    Declaration
    public bool Cancel { get; set; }
    Property Value
    Type Description
    System.Boolean

    A bool. The default value is false.

    Remarks

    Set this property to true to prevent the dialog from closing.

    ClosedBy

    Gets a value indicating how the dialog was requested to be closed.

    Declaration
    public string ClosedBy { get; set; }
    Property Value
    Type Description
    System.String

    A string that specifies the source of the close action (e.g., "CloseIcon", "Escape", or a custom user action).

    Remarks

    This property helps determine whether the dialog was closed via the close icon, the Escape key, or another user-defined action.

    Event

    Gets the underlying event arguments that triggered the close action.

    Declaration
    public EventArgs Event { get; set; }
    Property Value
    Type Description
    System.EventArgs

    An System.EventArgs object.

    Remarks

    This can be a Microsoft.AspNetCore.Components.Web.MouseEventArgs for a click or a Microsoft.AspNetCore.Components.Web.KeyboardEventArgs for a key press.

    IsInteracted

    Gets a value indicating whether the dialog was closed through user interaction.

    Declaration
    public bool IsInteracted { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if the closing was initiated by the user; otherwise, false.

    Remarks

    This allows distinguishing between programmatic closing and user-initiated actions.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved