User711641945 posted
Hi UrielMhezzek,
Could you share your service.Scount.Start()?It seems to be a method?Here is a simple demo as below,it could show 'Loading' when the application starts and show 'Scout' when you click the button:
1.Scount.cs
public class Scout
{
public bool IsRunning { get; set; }
}
2.Test.razor
@page "/test"
@using BlazorServerSidetest2.Data
<button class="btn btn-primary" type="button" @onclick="@IncrementCount">
@if (scount.IsRunning)
{
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
<span>Loading...</span>
}
else
{
<span>Scout</span>
}
</button>
@code {
Scout scount = new Scout() { IsRunning = true };
void IncrementCount()
{
scount.IsRunning = false;
}
}
Best Regards,
Rena