title: How to bind the position in a List to an attribute of that element?
body: <p>I have an <code>ObservableList&lt;MyElement&gt; list = FXCollections.observableArrayList();</code></p>
  
  <pre><code>public class MyElement
  {
    private IntegerProperty position;//with getter
    //[...]
  
    //somewhere in the constructor taking the list as argument
    position.bind(list.indexOf(this));
  }
  </code></pre>
  
  <p>Now I'd like to bind MyElement.position to the actual position in the list i.e. if the position changes in the list (for instance drag and drop in the GUI or anything else) I want the position property to be updated automatically.</p>
  
  <p>Is this possible? Can I make a bidirectional binding between these values?</p>