Hi, i want to inform the user when he clicked on a button that the process takes a long time.
My code:
protected async Task HeatPumpGridInterpolatedButtonClick( MouseEventArgs args, PiCon.Models.DbPiCon.HeatPump heatPump )
{
if ( await DialogService.Confirm( "This operation takes some time!" ) == true )
{
DialogService.Close();
isLoading = true;
// what to do to show the spinning icon
// what to do if the dialog is visible that the dialog closed
// the user has to be informed on the running process it takes about 2-4 minutes
var selectedValues = await DbPiConService.GetHeatPumpValues(
..... );
var selectedInterpolated = await DbPiConService.GetHeatPumpInterpolateds(
...... );
var result = Calculators.UpdateInterpolated( selectedValues, selectedInterpolated );
await DbPiConService.UpsertHeatPumpInterpolatedBulk( result.ToList() );
NotificationService.Notify( new NotificationMessage
{
Severity = NotificationSeverity.Success,
Summary = $"Succes",
Detail = String.Format( "{0} records interpolated", result.Count() )
} );
}
isLoading = false;
}