Why I can't bind to visible or enabled properties

Hi, I’ve just come across a situation that I would have liked to bind a component’s visible property to another components. This would be useful so as to not duplicate complicated expressions.

The case I have is 2 components with complicated expressions and then a label which is visible if either one is. Combining the expressions for the label is messy and much nicer to just say ‘If this or this is visible’.

I have a work around, a custom property isVisible with the expression, the component looks at its own isVisible and then the label does too.

Seems a bit silly though. Why can’t I just look at the components visible property?

There are many properties that fall in that category, mostly because they don’t fire propertyChange events.

The workaround you’re using is the best way to do this.

1 Like