Data Driven Layout in Server-side Blazor
September 24, 2018 in C# Blazor Razor ComponentsOne thing I stumbled on with Blazor was how to create a layout that changed based on the data on the page. For example, you may want to include bread crumbs in the header of your page. You could get the URL and try to parse out where in the application from your MainLayout, and then figure out what you need to figure out to create your breadcrumbs. But ideally you’d have each page figure out it’s own breadcrumbs and pass that data to the header.