I am getting this error:

Window must be the root of the tree. Cannot add Window as a child of Visual.