mirror of https://github.com/abpframework/abp.git
Browse Source
Introduce PageLayout to expose blazor breadcrumb items & action-toolbar itemspull/11528/head
committed by
GitHub
6 changed files with 123 additions and 24 deletions
@ -0,0 +1,36 @@ |
|||
# Page Layout |
|||
PageLayout is used to define page-specific elements across application. |
|||
|
|||
|
|||
## Title |
|||
Title is used to render page title in the PageHeader. |
|||
|
|||
```csharp |
|||
@inject PageLayout PageLayout |
|||
|
|||
@{ |
|||
PageLayout.Title = "My Page Title"; |
|||
} |
|||
``` |
|||
|
|||
## BreadCrumbs |
|||
BreadCrumbItems are used to render breadcrumbs in the PageHeader. |
|||
```csharp |
|||
@inject PageLayout PageLayout |
|||
|
|||
@{ |
|||
PageLayout.BreadcrumbItems.Add(new BlazoriseUI.BreadcrumbItem("My Page", "/my-page")); |
|||
} |
|||
``` |
|||
|
|||
## Toolbar |
|||
ToolbarItems are used to render action toolbar items in the PageHeader. |
|||
|
|||
Check out [Page Toolbar](https://docs.abp.io/en/abp/latest/UI/Blazor/Page-Header#page-toolbar) |
|||
|
|||
```csharp |
|||
@inject PageLayout PageLayout |
|||
@{ |
|||
PageLayout.ToolbarItems.Add(new PageToolbars.PageToolbarItem(typeof(MyButtonComponent))); |
|||
} |
|||
``` |
|||
@ -0,0 +1,8 @@ |
|||
namespace Volo.Abp.AspNetCore.Components.Web.Theming.Layout; |
|||
|
|||
public class PageHeaderOptions |
|||
{ |
|||
public bool RenderPageTitle { get; set; } = true; |
|||
public bool RenderBreadcrumbs { get; set; } = true; |
|||
public bool RenderToolbar { get; set; } = true; |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.AspNetCore.Components.Web.Theming.PageToolbars; |
|||
using Volo.Abp.BlazoriseUI; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.Web.Theming.Layout; |
|||
|
|||
public class PageLayout : IScopedDependency |
|||
{ |
|||
// TODO: Consider using this property for setting Page Title too.
|
|||
public virtual string Title { get; set; } |
|||
|
|||
public virtual List<BreadcrumbItem> BreadcrumbItems { get; set; } = new(); |
|||
|
|||
public virtual List<PageToolbarItem> ToolbarItems { get; set; } = new(); |
|||
} |
|||
Loading…
Reference in new issue