Building Single Page Applications in .NET Core 3 by Michele Aponte
Author:Michele Aponte
Language: eng
Format: epub
ISBN: 9781484257470
Publisher: Apress
Listing 3-8The Code That Manages the Main Menu Component in the App Component
Note the method MenuItemClick(), called when the OnMenuItemClick custom event is raised: the code sets the Active property of the MenuItems array to false and also sets the Active property of the item clicked to true. The change detection of Blazor notes this change and updates the user interface, setting the active class on the item clicked. The fascinating aspect is the way it executes the update: Blazor knows the state of the user interface, so when the code wants to change it, the framework computes the difference between the actual state and the new state and applies the difference only to the DOM of the browser. This technique, also used by many JavaScript frameworks, speeds up the update of the user interface significantly.
In Figure 3-5, you can see the result of our work. Using the OnMenuItemClick event , we can show or hide other components, simulating the page navigation. By doing it this way, besides being too laborious, we would also miss out on advanced navigation features, which we can get for free by using the routing features made available by the framework.
Figure 3-5The main menu component in action
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
NET | C & C++ Windows Programming |
SQL Server | VBA |
Visual Basic |
Deep Learning with Python by François Chollet(12566)
Hello! Python by Anthony Briggs(9911)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9795)
The Mikado Method by Ola Ellnestam Daniel Brolund(9775)
Dependency Injection in .NET by Mark Seemann(9336)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8293)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7758)
Grails in Action by Glen Smith Peter Ledbrook(7693)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7557)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(7027)
Microservices with Go by Alexander Shuiskov(6794)
Practical Design Patterns for Java Developers by Miroslav Wengner(6706)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6647)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6409)
Angular Projects - Third Edition by Aristeidis Bampakos(6055)
The Art of Crafting User Stories by The Art of Crafting User Stories(5586)
NetSuite for Consultants - Second Edition by Peter Ries(5519)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5321)
Kotlin in Action by Dmitry Jemerov(5062)
