menu

Blazor

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

    Show / Hide Table of Contents

    Class MessageCloseEventArgs

    Provides information about the Closed event.

    Inheritance
    System.Object
    MessageCloseEventArgs
    Namespace: Syncfusion.Blazor.Notifications
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class MessageCloseEventArgs : Object
    Remarks

    This class contains event arguments that are passed when a message component is closed. It helps distinguish between automatic closures and user-initiated closures, which can be useful for tracking user interactions and implementing custom logic based on the closure method.

    Examples

    The following example demonstrates how to use the MessageCloseEventArgs in a Closed event handler:

    <SfMessage Closed="@OnMessageClosed">
        Your message content here
    </SfMessage>
    
    @code {
        private void OnMessageClosed(MessageCloseEventArgs args)
        {
            if (args.IsInteracted)
            {
                // User explicitly closed the message
                Console.WriteLine("Message was closed by user interaction");
            }
            else
            {
                // Message was closed automatically (e.g., timeout)
                Console.WriteLine("Message was closed automatically");
            }
        }
    }

    Constructors

    MessageCloseEventArgs()

    Declaration
    public MessageCloseEventArgs()

    Properties

    IsInteracted

    Gets or sets a value indicating whether the message close event was triggered by user interaction.

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

    true if the event was triggered by user interaction such as clicking the close button or pressing the Escape key; otherwise, false for automatic closures such as timeout-based dismissals.

    Remarks

    This property is essential for determining the cause of message closure. When true, it indicates that the user actively dismissed the message through direct interaction (clicking close button, pressing Escape key, etc.). When false, it indicates the message was closed automatically by the system (such as timeout expiration, programmatic closure, or other non-interactive triggers). This distinction helps in implementing different behaviors based on whether the closure was intentional user action or system-initiated.

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