Layout Definition
The layout structures the pages of the Lagoon client application. It is defined in the Client project, typically with two components placed in Shared: App.razor for the application structure and MenuConfiguration.razor for the menus.
App.razor is the root component registered in Client/Main.cs with builder.RootComponents.Add<Shared.App>("#app").
Minimal structure
<LgApp DefaultLayout="typeof(MainLayout)"
IsTabbed="true"
ShowHeader="true"
ShowSidebar="false"
ShowFooter="true">
<StartupTabs>
<LgStartupTab Link="Demo.Client.Pages.Index.Link()" />
</StartupTabs>
<FooterContent>
<MyFooterComponent />
</FooterContent>
<ChildContent>
<MenuConfiguration />
</ChildContent>
</LgApp>
MenuConfiguration is placed in ChildContent so that the layout has the menu elements to render in the declared areas.
Areas controlled by LgApp
| Parameter | Role |
|---|---|
DefaultLayout | Blazor layout type used by default when a page does not declare one. |
IsTabbed | Enables application tab navigation mode. |
ShowHeader | Displays the top header with the logo and main menu. |
ShowFooter | Displays the bottom footer. Its content is customizable with FooterContent. |
ShowSidebar | Displays a sidebar on the left of the application. |
The header toolbar is configured in MenuConfiguration.razor via the Toolbar fragment.
Tabs open at startup
Add multiple LgStartupTab components to open multiple pages when the application starts.
<LgApp IsTabbed="true" ShowHeader="true">
<StartupTabs>
<LgStartupTab Link="HomePage.Link()" Default="true" />
<LgStartupTab Link="DashboardPage.Link()" Closable="true" />
</StartupTabs>
<ChildContent>
<MenuConfiguration />
</ChildContent>
</LgApp>
LgStartupTab accepts notably Link, Default, Closable, and PolicyVisible. Use PolicyVisible to open a startup tab only if the requested policy is satisfied.
Custom footer
The footer is rendered only when ShowFooter is true.
<LgApp ShowFooter="true">
<FooterContent>
<MyFooterComponent />
</FooterContent>
<ChildContent>
<MenuConfiguration />
</ChildContent>
</LgApp>
@inherits LgComponentBase
<LgLabel Text="#footerCopyright" />