I understand that an Action represents an action to be performed on an object, however in a few code bases I have seen parameters declared as Action<Action<T>> and struggle to understand what an action to be performed on another action means.
So conceptually what does an Action<Action<T>> represent, and can you suggest an example where you would use one ?
Starting from the end, I have used this pattern to create a multithreaded “progress” dialog while long tasks run on the main thread. I call my progress dialog creating function with a lambda that does the work, which receives a lambda that knows how to update the progress bar and status text. Something like this:
So my
Runfunction is declared like this:Generalizing, any worker lambda that receives a lambda from the function itself would use this pattern.