Private Task UpdateLastMultipleOfThreeValue(int value) Last multiple of two = multiple of three = LastMultipleOfTwo = 0 ![]() Now alter the Index component so that it sets a method to callback whenever the value is a multiple of two, and so it also stores and displays the last number received from OnMultipleOfTwoAction on the consumed component. If the current count is a multiple of two, then invoke OnMultipleOfTwoAction OnMultipleOfTwoAction?.Invoke(currentCount) Īwait OnMultipleOfThree.InvokeAsync(currentCount) In a new Blazor app, edit the /Pages/Counter.razor file and add a new callback parameter. Once a public property of type EventCallback has been declared and decorated with the attribute, consuming components can specify in Razor mark-up which method to call when the event is triggered. The EventCallback class is a special Blazor class that can be exposed as a Parameter so that components can easily notify consumers when something of interest has occurred.
0 Comments
Leave a Reply. |