Update PageLayout documentation for MenuItemName

pull/12840/head
Enis Necipoglu 3 years ago
parent 249afe95f1
commit 1a6c44d3ab

@ -13,6 +13,37 @@ Title is used to render page title in the PageHeader.
}
```
## MenuItemName
Indicates current selected menu item name. Menu item name should match a unique menu item name defined using the [Navigation / Menu system](../Blazor/Navigation-Menu.md). In this case, it is expected from the theme to make the menu item "active" in the main menu.
```csharp
@inject PageLayout PageLayout
@code {
protected override async Task OnInitializedAsync()
{
PageLayout.MenuItemName = "MyProjectName.Products";
}
}
```
Menu item name can be set on runtime too.
```html
@inject PageLayout PageLayout
<Button Clicked="SetCategoriesMenuAsSelected">Change Menu</Button>
@code{
protected void SetCategoriesMenuAsSelected()
{
PageLayout.MenuItemName = "MyProjectName.Categories";
}
}
```
> Be aware, The [Basic Theme](../Blazor/Basic-Theme.md) currently doesn't support the selected menu item since it is not applicable to the top menu.
## BreadCrumbs
BreadCrumbItems are used to render breadcrumbs in the PageHeader.
```csharp

Loading…
Cancel
Save