I have a Spark ButtonBar that has a custom skin, which defines a custom skin for the "middleButton" requirement. My CustomButtonBarSkin has a custom state, minimized, which I want to pass into my middleButton skin so it can modify its design.
Is it possible to do this? I can see that my button skin could use parentDocument.currentState to get the minimized state, but that's really ugly. Any way to pass a skin from the bar to the child button(s)?
I think you should extend default
ButtonBar
. Something like this:So using this code you can declare your custom skin with the following way:
Hope this solves your problem.
And if your minimized state is only about changing middle button skin you can remove all states related code both from custom component and from skin.