Looking at UITK’s Toggle, I was trying to figure out how to trigger the :checked pseudostate for a custom control. It looks like Toggle is using VisualElements.pseudoStates property, but this is an internal property that I cannot access. Unity docs say that pseudostates cannot be added or modified, but is it possible to allow devs to trigger existing pseudostates on custom controls?
Use the method SetValueWithoutNotify() to manage the state value. You can check the reference of this value in the code.
This may help: Set pseudo-state style from C# script (it’s an ugly solution, but it works…)
Thank you for the response, the reflection workaround works very well!
For SetValueWithoutNotify, I think this would work if I was extending BaseBoolField