Class SpeedDialBeforeOpenCloseEventArgs
Provides information about the Opening and Closing event callbacks, allowing optional cancellation of the opening or closing action.
Inheritance
Namespace: Syncfusion.Blazor.Buttons
Assembly: Syncfusion.Blazor.dll
Syntax
public class SpeedDialBeforeOpenCloseEventArgs : Object
Remarks
This event argument is used in pre-open and pre-close scenarios for the SfSpeedDial component, allowing you to intercept, modify, or prevent the open/close action.
Examples
This example demonstrates how to prevent the opening of a SpeedDial:
<SfSpeedDial Opening="OnSpeedDialOpening">
</SfSpeedDial>
@code {
private void OnSpeedDialOpening(SpeedDialBeforeOpenCloseEventArgs args)
{
// Conditionally prevent opening
if (SomeCondition)
{
args.Cancel = true;
}
}
}
Constructors
SpeedDialBeforeOpenCloseEventArgs()
Declaration
public SpeedDialBeforeOpenCloseEventArgs()
Properties
Cancel
Gets or sets a value indicating whether to cancel the open or close action of the SpeedDial component.
Declaration
public bool Cancel { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | A |
Remarks
Speed dial displays a list of action buttons on click, and the list is closed when a speed dial item is clicked. This property enables you to programmatically control the open/close lifecycle.
Examples
Preventing the closing of SpeedDial when a condition is met:
void OnClosing(SpeedDialBeforeOpenCloseEventArgs args)
{
if (needToBlock)
{
args.Cancel = true;
}
}
Element
Gets the reference to the popup element of the SfSpeedDial.
Declaration
public ElementReference Element { get; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.ElementReference | An Microsoft.AspNetCore.Components.ElementReference representing the popup element of the SpeedDial. |
Remarks
You can use this property to access or manipulate the popup element directly if required, for advanced DOM customizations or manipulation.