Browse Source

Added Blazor UI branding doc.

pull/6279/head
Halil İbrahim Kalkan 5 years ago
parent
commit
74fa373710
  1. 2
      docs/en/UI/AspNetCore/Branding.md
  2. 37
      docs/en/UI/Blazor/Branding.md
  3. 4
      docs/en/docs-nav.json
  4. 4
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyProjectNameBrandingProvider.cs

2
docs/en/UI/AspNetCore/Branding.md

@ -11,7 +11,7 @@ The screenshot below shows *MyProject* as the application name:
You can implement the `IBrandingProvider` interface or inherit from the `DefaultBrandingProvider` to set the application name:
````csharp
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Components;
using Volo.Abp.Ui.Branding;
using Volo.Abp.DependencyInjection;
namespace MyProject.Web

37
docs/en/UI/Blazor/Branding.md

@ -0,0 +1,37 @@
# Blazor UI: Branding
## IBrandingProvider
`IBrandingProvider` is a simple interface that is used to show the application name and logo on the layout.
The screenshot below shows *MyProject* as the application name:
![branding-nobrand](../../images/branding-nobrand.png)
You can implement the `IBrandingProvider` interface or inherit from the `DefaultBrandingProvider` to set the application name:
````csharp
using Volo.Abp.DependencyInjection;
using Volo.Abp.Ui.Branding;
namespace MyCompanyName.MyProjectName.Blazor
{
[Dependency(ReplaceServices = true)]
public class MyProjectNameBrandingProvider : DefaultBrandingProvider
{
public override string AppName => "Book Store";
}
}
````
The result will be like shown below:
![branding-appname](../../images/branding-appname.png)
`IBrandingProvider` has the following properties:
* `AppName`: The application name.
* `LogoUrl`: A URL to show the application logo.
* `LogoReverseUrl`: A URL to show the application logo on a reverse color theme (dark, for example).
> **Tip**: `IBrandingProvider` is used in every page refresh. For a multi-tenant application, you can return a tenant specific application name to customize it per tenant.

4
docs/en/docs-nav.json

@ -598,6 +598,10 @@
"text": "Page Alerts",
"path": "UI/Blazor/Page-Alerts.md"
},
{
"text": "Branding",
"path": "UI/Blazor/Branding.md"
},
{
"text": "Customization / Overriding Components",
"path": "UI/Blazor/Customization-Overriding-Components.md"

4
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyProjectNameBrandingProvider.cs

@ -1,7 +1,9 @@
using Volo.Abp.Ui.Branding;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Ui.Branding;
namespace MyCompanyName.MyProjectName.Blazor
{
[Dependency(ReplaceServices = true)]
public class MyProjectNameBrandingProvider : DefaultBrandingProvider
{
public override string AppName => "MyProjectName";

Loading…
Cancel
Save