How do you execute something similar to settimeout in C# Blazor as an infinite loop with UI Changes through data manipulation?
@code{
protected async override void OnInitialized()
{
var task = new Task(() =>
{
while (true)
{
ExternalClassFile.DoWork();
Thread.Sleep(1000);
this.InvokeAsync(() => this.StateHasChanged());
}
});
task.Start();
base.OnInitialized();
}
}