Slate - Visibility delegate

TAttributes are a special wrapper that enables treating direct values and delegate bindings in a transparent fashion. There are lots of ways of initializing delegates, so the slate macros just provide lots of alternate ways of doing this with minimal effort.

What’s happening here is that the Visibility attribute is initialized to use a delegate rather than a value. The delegate is PendingActionVisibility, and is directly called each time Slate needs to know the visibility of the widget.

Using delegates in attributes enables one of the core tenets of Slate, which is to pull values rather than push, so that you don’t have to manually handle state changes and propagate the results of said changes to your widget. In the above example, depending on the value of PendingAction, one of the attributes will return collapsed and the other will return visible, enabling the right section of the UI to be displayed depending on the state of PendingAction.