c# check if task is running
How about
Task t = Task.Run(() => ...);
if(t.Status.Equals(TaskStatus.Running))
{
//task is running
}
Basically I would store my tasks somewhere and make them accessible for other classes. Then you can check the status of the task with the code above. Refer to the TaskStatus-Documentation.
This is what worked for me.
Task t = Task.Run(() => ...);
if(t.IsCompleted.Equals(false)) // or if(t.Status.Equals(TaskStatus.WaitingForActivation)
{
}