Say I have the following code:
import scalafx.beans.property.ObjectProperty
import scalafx.scene.image.Image
def foo(property: ObjectProperty[Image]) = {...}
Then somewhere else I have an image view who's imageProperty I want to pass to the function:
import scalafx.scene.image.ImageView
val view: ImageView
...
val property = view.image
foo(property) // will not compile
This will not compile as the property returned from image is a javafx..Image as opposed to scalafx.
Is it sufficient to do
foo(property.asInstanceOf[ObjectProperty[Image]])
or is there a better way of converting?