I try to make a simple context menu which will open at the pointer position on longpress event.
If pointer position is near the bounding screen (advanced full texture) i check if the pointer position + context menu size is outside bounding screen if true i recompute the position to put the context menu inside screen.
The problem is when the first long press is triggered the width of my context menu seems to be equals to 100% of the screen width instead of the real size.
After that the second long press open the context menu at the good position because size of context menu has been recomputed correctly.
I’ve tried to play with makeDirty methods… with no success.
Is there a way to wait next frame or call a method to force the computation or better solution ?
See methods _compute… inside method showAt()
/!\ Don’t forget to press any key to fill the contextmenu
I guess it is the same kind of problem but the buttons width do not use 100% of the parent. If I use original TextWrapping.WordWrap options the stackpanel take 100% of the screen.
How to have children taking 100% of stackpanel ?