How to wait Func<T>().invoike in C# : I have a method to show loading form with parameter Func<T> and in that method I use func.Invoke(); this.Close();
but in this cast this.Close(); not waiting for func.Invoke to finish.

Help me please. :)

    private void ShowLoading<T>(Func<T> func)
        {
            func.Invoke();

            this.Close();
        }