-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11509 from abpframework/enisn/blazor-page-header
Introduce PageLayout to expose blazor breadcrumb items & action-toolbar items
- Loading branch information
Showing
6 changed files
with
123 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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))); | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeaderOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
16 changes: 16 additions & 0 deletions
16
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageLayout.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} |