Class TooltipEventArgs
Provides data for Tooltip-related events and contains properties that describe the event context and state.
Inheritance
Namespace: Syncfusion.Blazor.Popups
Assembly: Syncfusion.Blazor.dll
Syntax
public class TooltipEventArgs : Object
Remarks
This class serves as the base event argument class for all Tooltip events, providing common properties such as cancellation support, position information, and target element details. Event handlers can use these properties to access information about the Tooltip state and modify the behavior as needed.
Examples
private void OnTooltipBeforeOpen(TooltipEventArgs args)
{
if (args.Target != null && args.HasText)
{
// Custom logic for tooltip positioning
args.Left = 100;
args.Top = 50;
}
}
Constructors
TooltipEventArgs()
Declaration
public TooltipEventArgs()
Properties
Cancel
Gets or sets a value indicating whether the current action should be cancelled.
Declaration
public bool Cancel { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
Setting this property to true
in event handlers will prevent the default Tooltip behavior from executing, allowing for custom handling of the event.
CollidedPosition
Gets or sets the adjusted position of the Tooltip after collision detection has been applied.
Declaration
public string CollidedPosition { get; set; }
Property Value
Type | Description |
---|---|
System.String | A |
Remarks
This property indicates the position where the Tooltip will be displayed after the collision detection algorithm has determined the best placement to keep the Tooltip within the viewport boundaries.
Event
Gets or sets the current event object that triggered the Tooltip event.
Declaration
public EventArgs Event { get; set; }
Property Value
Type | Description |
---|---|
System.EventArgs | An System.EventArgs object representing the original event that caused the Tooltip event to be raised. The default value is |
Remarks
This property provides access to the underlying DOM event information, such as mouse events or keyboard events, that initiated the Tooltip action.
HasText
Gets or sets a value indicating whether the Tooltip content contains text characters.
Declaration
public bool HasText { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
This property is used to determine if the Tooltip has meaningful text content to display. It helps in deciding whether to show the Tooltip or skip it when the content is empty.
IsInteracted
Gets or sets a value indicating whether the event was triggered by user interaction.
Declaration
public bool IsInteracted { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
This property helps distinguish between events triggered by direct user actions (such as mouse hover or click) and events triggered programmatically through code.
Left
Gets or sets the horizontal position (X-coordinate) where the Tooltip should be displayed.
Declaration
public Nullable<double> Left { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Double> | A |
Remarks
This property specifies the clientX position for positioning the Tooltip. The value represents the distance from the left edge of the viewport to the desired Tooltip position.
Target
Gets or sets the target element where the Tooltip is to be displayed.
Declaration
public DOM Target { get; set; }
Property Value
Type | Description |
---|---|
DOM | A DOM object representing the target element. The default value is |
Remarks
This property provides access to the DOM element that serves as the target for the Tooltip display.
Note: This property is obsolete from 2023 volume 3 release and should not be used in new implementations.
Top
Gets or sets the vertical position (Y-coordinate) where the Tooltip should be displayed.
Declaration
public Nullable<double> Top { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Double> | A |
Remarks
This property specifies the clientY position for positioning the Tooltip. The value represents the distance from the top edge of the viewport to the desired Tooltip position.
Type
Gets or sets the type of event that triggered the Tooltip action.
Declaration
public string Type { get; set; }
Property Value
Type | Description |
---|---|
System.String | A |
Remarks
This property indicates the specific type of user interaction or event that caused the Tooltip to be triggered. The common event types that will be received include:
- mouseover - When the mouse pointer enters the target element
- mouseleave - When the mouse pointer leaves the target element
- mousedown - When a mouse button is pressed on the target element