blazor-devexpress-dot-blazor-0b9bf6c1.md
A loading indicator component that can be embedded into other UI components.
Namespace : DevExpress.Blazor
Assembly : DevExpress.Blazor.v25.2.dll
NuGet Package : DevExpress.Blazor
public class DxWaitIndicator :
DxComponentBase
The Wait Indicator component displays progress of time-consuming operations. You can embed Wait Indicator into other UI components (for example, buttons or data editors).
Follow the steps below to add a Wait Indicator component to an application:
.razor file: <DxWaitIndicator>…</DxWaitIndicator>.Refer to the following list for the component API reference: DxWaitIndicator Members.
Blazor Wait Indicator supports static render mode to indicate progress with streaming rendering. For other features, you need to enable interactivity on a Razor page and allow the Wait Indicator component to execute scripts and display data.
@rendermode InteractiveServer
Use the Visible property to show/hide the Wait Indicator when an operation starts/finishes.
The following example imitates a lengthy operation. During this operation the Button becomes disabled and the Wait Indicator appears.
<DxButton Enabled="!isSending"
Click="Send"
RenderStyle="ButtonRenderStyle.Secondary">
<div class="d-flex">
<DxWaitIndicator Visible="isSending" />
<span class="mx-2">@Message</span>
</div>
</DxButton>
@code{
bool isSending = false;
string Message => isSending ? "Sending..." : "Send";
private async Task Send() {
isSending = true;
await Task.Delay(3000);
isSending = false;
}
}
Use the CssClass property to apply custom styles to the Wait Indicator.
<DxButton Enabled="!isSending"
Click="Send"
RenderStyle="ButtonRenderStyle.Primary">
<div class="d-flex">
<DxWaitIndicator Visible="isSending"
CssClass="my-indicator" />
<span class="mx-2">@Message</span>
</div>
</DxButton>
@code{
bool isSending = false;
string Message => isSending ? "Sending..." : "Send";
private async Task Send() {
isSending = true;
await Task.Delay(3000);
isSending = false;
}
}
.my-indicator {
opacity: 0.5;
}
You can also customize the component’s content. Use the following API members:
AnimationTypeSpecifies the animation type.TemplateSpecifies custom content (for example, an icon) for the Wait Indicator.SizeModeSpecifies the size of the component.
Object ComponentBase DxComponentBase DxWaitIndicator
See Also