-
Book Overview & Buying
-
Table Of Contents
Web Development with Blazor - Fourth Edition
By :
When building applications, data is important, and we can use binding to show or change data. Binding is the process of connecting data in our component to the user interface so that changes in one are reflected in the other. By using binding, you can connect variables within a component (so that they update automatically) or set a component attribute. Perhaps the most fantastic thing is that by using binding, Blazor understands when it should update the UI and the variable (if the data changes in the UI). In Blazor, there are two different ways that we can bind values to components, as follows:
By using bindings, we can send information between components and ensure we can update a value when we want to.
We have already touched on one-way binding in Chapter 6, Understanding Basic Blazor Components, even though we never called it binding. In the Counter component, updating the currentCount variable causes the UI to update...