Creating reusable Razor components
In this section, we can create reusable components by optimizing our code. Throughout the process, we can get a better understanding of the features of Razor components and how to make them reusable.
We created the Blazor Hybrid version of our app, PassXYZ.Vault in Chapter 7, Introducing Blazor Hybrid App Development, and we added layout and routing functionalities to it in Chapter 8, Understanding the Blazor Layout and Routing. Our app can browse and update the password database now. So far, we haven’t implemented most of the CRUD operations. We will add these functionalities after we refine our Razor components in this chapter.
To navigate the password database, we created two Razor components – Items
and ItemDetail
– in Chapter 7, Introducing .NET MAUI Blazor. The Items
class is used to display a list of password entries and groups in the current group, and the ItemDetail
class is used to display the content of a password...