RelativeTo="PositionOffset" RelativeNode="..." issue


From this code i want to display selected item on the top of the screen with the help of “RelativeTo” and “RelativeNode”, i face an issue when item is selected it’s part is out of the viewport, may i missed something ?
I attached a video to illustrate the issue.
Thank you