Posts

Showing posts from November, 2025

Creating Advanced Blazor Components

Image
  Exploring Binding By utilizing bindings, you can link variables either inside a component (allowing for automatic updates) or by assigning a component attribute. In Blazor, we can bind values to components and there are two different ways to do this: One-way binding Two-way binding Through the use of binding, we can transmit information between components and ensure that we can modify a value whenever we choose. Adding Actions and EventCallback To relay changes, we can utilize EventCallback . EventCallback<T> has some differences compared to what we might recognize in .NET. It is a class specifically designed for Blazor, allowing the event callback to be made available as a parameter for the component. In .NET as a whole, it is possible to attach several listeners to an event (multi-cast), whereas with EventCallback<T> , you can only attach a single listener (single-cast). It's important to note that you can utilize events in Blazor similarly to how you do in .NET. H...