Back to Devexpress

LoadingIndicatorButtonInfo Class

wpf-devexpress-dot-xpf-dot-editors-ef4967c8.md

latest3.5 KB
Original Source

LoadingIndicatorButtonInfo Class

Represents a loading indicator displayed within the ButtonEdit and its descendants.

Namespace : DevExpress.Xpf.Editors

Assembly : DevExpress.Xpf.Core.v25.2.dll

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public class LoadingIndicatorButtonInfo :
    ButtonInfoBase
vb
Public Class LoadingIndicatorButtonInfo
    Inherits ButtonInfoBase

Remarks

The LoadingIndicatorButtonInfo class implements the functionality of a loading indicator displayed within the button editors (e.g., ButtonEdit, DateEdit, etc.).

How to Add the Loading Indicator

Add a LoadingIndicatorButtonInfo class instance to the editor’s ButtonEdit.Buttons (ButtonEditSettings.Buttons for the in-place ButtonEdit) collection.

To display and hide the loading indicator, use its Visibility property.

Example

The code sample below illustrates how to show the LoadingIndicatorButtonInfo during the long running operation and hide the loading indicator when the operation is complete.

xaml
<dxe:ButtonEdit
    AllowDefaultButton="False">
    <dxe:ButtonEdit.Buttons>
        <dxe:LoadingIndicatorButtonInfo Visibility="Collapsed" x:Name="loadingIndicator"/>
        <dxe:ButtonInfo GlyphKind="Refresh" Click="ButtonInfo_Click"/>
    </dxe:ButtonEdit.Buttons>
</dxe:ButtonEdit>
csharp
private async void ButtonInfo_Click(object sender, RoutedEventArgs e) {
    loadingIndicator.Visibility = Visibility.Visible;
    // Perform a long running operation instead of Task.Delay
    await Task.Delay(2000);
    loadingIndicator.Visibility = Visibility.Collapsed;
    e.Handled = true;
}
vb
Private Async Sub ButtonInfo_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
    loadingIndicator.Visibility = Visibility.Visible
    ' Perform a long running operation instead of Task.Delay
    Await Task.Delay(2000)
    loadingIndicator.Visibility = Visibility.Collapsed
    e.Handled = True
End Sub

The animation below illustrates the result:

Inheritance

Object DispatcherObject DependencyObject ContentElement FrameworkContentElement ButtonInfoBase LoadingIndicatorButtonInfo

See Also

LoadingIndicatorButtonInfo Members

DevExpress.Xpf.Editors Namespace