On State Update Attribute

OnStateUpdate provides an event callback when the property's state should be updated, when the StateUpdaters run on the property instance. This generally happens at least once per frame, and the callback will be invoked even when the property is not visible. This can be used to approximate custom StateUpdaters like [ShowIf] without needing to make entire attributes and StateUpdaters for one-off cases.

public List<string> list;

[OnStateUpdate("@#(list).State.Expanded = $value")]
public bool ExpandList;

[OnStateUpdate("@$property.State.Expanded = ExpandList")]
public List<string> list;

public bool ExpandList;

[OnStateUpdate("@$property.State.Visible = ToggleMyInt")]
public int MyInt;

public bool ToggleMyInt;