title: JavaFX bind a child's property to its parent's property as soon as a new child is added
body: <p>I hava a <code>Pane</code> which is zoomable. I would like to scale all the children in this <code>Pane</code> respectively. Children can be added dynamically, so I was thinking of binding the scale property of the child to its parent's scale property once a new child is added but I have no idea how one can do this.</p>
  
  <p>I currently scale all children as soon as the pane is scaled:</p>
  
  <pre><code>public class ZoomableCanvas extends Pane {
  
      DoubleProperty scale = new SimpleDoubleProperty(1.0);
  
      public ZoomableCanvas() {
          scaleXProperty().bind(scale);
          scaleYProperty().bind(scale);
      }
  
      public double getScale() {
          return scale.get();
      }
  
      public void setScale(double scale) {
          this.scale.set(scale);
          for (javafx.scene.Node child : getChildren()) {
              child.setScaleX(scale);
              child.setScaleY(scale);
          }
      }
  
      public void setPivot(double x, double y) {
          setTranslateX(getTranslateX() - x);
          setTranslateY(getTranslateY() - y);
      }
  }
  </code></pre>
  
  <p>But there has to be a more elegant way. How can I listen for the adding of children and then bind the property?</p>