How to notify the double click event in Blazor Diagram?
In a Blazor Diagram component, the Click event is triggered when an object or the diagram itself is clicked.
Utilizing the Click event and its arguments provides valuable information, such as the click count, element, actual object, button, and the position of the click. Based on the click count, you can determine if a double-click action has occurred and execute custom actions accordingly.
The following code snippet demonstrates how to handle the Click event and detect a double-click event in a Blazor Diagram component:
Code Snippet:
<SfDiagramComponent @ref="@Diagram"
Width="100%"
Height="700px"
Nodes="nodes"
Click="OnClick">
</SfDiagramComponent>
private void OnClick(Syncfusion.Blazor.Diagram.ClickEventArgs args)
{
if(args.Count==2)
{
}
}
In this example, when the diagram or an object within the diagram is clicked twice, the OnClick method is triggered. The condition args.Count == 2 checks for a double-click event, allowing you to implement custom actions for double-clicks.
You can download the complete working sample from here.
Conclusion:
We hope you enjoyed learning about how to detect double-click events in Blazor Diagram.
You can refer to our Blazor Diagram feature tour page to learn about its other groundbreaking features, documentation, and how to quickly get started with configuration specifications. You can also explore our Blazor Diagram example to understand how to create and manipulate data.
For current customers, our Blazor components are available on the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to evaluate our Blazor Diagram and other Blazor components.
If you have any questions or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!