Browse Source

Add `Block-Busy.md`.

pull/19453/head
maliming 2 years ago
parent
commit
b0cea22383
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 38
      docs/en/UI/Blazor/Block-Busy.md
  2. 4
      docs/en/docs-nav.json
  3. 2
      framework/src/Volo.Abp.AspNetCore.Components.Web/wwwroot/libs/abp/css/abp.css

38
docs/en/UI/Blazor/Block-Busy.md

@ -0,0 +1,38 @@
# Blazor UI: Block/Busy Service
UI Block disables (blocks) the page or a part of the page.
## Quick Example
Simply [inject](../../Dependency-Injection.md) `IBlockUiService` to your page or component and call the `Block/UnBlock` method to disables (blocks) the element.
```csharp
namespace MyProject.Blazor.Pages
{
public partial class Index
{
private readonly IBlockUiService _blockUiService;
public Index(IBlockUiService _blockUiService)
{
_blockUiService = blockUiService;
}
public async Task BlockForm()
{
/*
Parameters of Block method:
selectors: A string containing one or more selectors to match
busy : Set to true to show a progress indicator on the blocked area.
*/
await _blockUiService.Block(selectors: "#MySelectors", busy: true);
}
}
}
```
The resulting UI will look like below:
![ui-busy](../../images/ui-busy.png)
Then you can use `_blockUiService.UnBlock()` to re-enable the busy area/page.

4
docs/en/docs-nav.json

@ -958,6 +958,10 @@
{ {
"text": "Page Progress", "text": "Page Progress",
"path": "UI/Blazor/Page-Progress.md" "path": "UI/Blazor/Page-Progress.md"
},
{
"text": "Block/Busy",
"path": "UI/Blazor/Block-Busy.md"
} }
] ]
}, },

2
framework/src/Volo.Abp.AspNetCore.Components.Web/wwwroot/libs/abp/css/abp.css

@ -15,7 +15,7 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
z-index: 102; z-index: 102;
background-color: #fff; background-color: #fff !important;
opacity: .8; opacity: .8;
transition: opacity .25s; transition: opacity .25s;
} }

Loading…
Cancel
Save