Binding with two sources properties

Hello,

I have this binding :

new go.Binding('visible', 'desiredSize', function(size, data) {
  console.log(size, data);
 }).ofObject(shapesName.TABLE)

I had like to access both desiredSize and maxSize of the ‘shapesName.TABLE’ Panel, is there an easy way to do that.

Right now i am doing this stuff :

 new go.Binding('visible', 'desiredSize', function(size, data) {

       var maxHeight =  data.part.findObject(shapesName.TABLE).maxSize.height;
       var currentHeight = size.height;
       if (currentHeight < maxHeight) {
         return true;
        }
        return false;
     }).ofObject(shapesName.TABLE)

which is quite ugly…

Thanks !

The natural thing to do would be to use the empty string as the source property name, but apparently that is not re-evaluated as often as it should be when the binding’s source is a GraphObject. I’ll investigate that.

For now, your conversion function could be a bit prettier:

function(size, gobj) {
    var maxHeight = gobj.part.findObject(shapesName.TABLE).maxSize.height;
    return size.height < maxHeight;
}