o capture a component reference in Blazor, use the @ref
directive attribute. The value of the attribute should match the name of a settable field with the same type as the referenced component.
<MyLoginDialog @ref="loginDialog" ... /> @code { MyLoginDialog loginDialog; void OnSomething() { loginDialog.Show(); } }
References
https://docs.microsoft.com/en-us/dotnet/architecture/blazor-for-web-forms-developers/components#capture-component-references
https://www.syncfusion.com/faq/blazor/components/how-do-i-get-the-reference-or-instance-of-a-component