royibernthal Posted October 14, 2017 Share Posted October 14, 2017 I have a container that dynamically positions controls according to their size and some ordering settings. Something like a StackPanel but more suited to my project's needs. This container mostly contains children whose size is already defined by the time they're added to the container. The container is updated every time the children are drawn. In this container, I also have a TextBlock with resizeToFit set to true, which means its size is dynamically evaluated at runtime in TextBlock/_renderLines(). The problem is, the other container's children can be drawn before TextBlock size is evaluated, which results in a mess for a split second until it is drawn and the container is updated. My goal is to hide the container until the TextBlock's size has been evaluated, and save this little mess from the eyes of the user. This leads me to this question - Is there a way to make the container invisible to the user but still draw it invisibly? Setting control.isVisible = false results in no further draw calls for the control, I suppose since it means there's no point in rendering it. From my testing the same goes for control.notRenderable = true. If there are no further draw calls, it means the TextBlock size is never measured, meaning even if I manually add it again without depending on Control/onAfterDrawObservable, the mess for a split second will remain as nothing was achieved. I would've posted a PG but it'd be too cumbersome given the involved project's classes. You can assume everything is working as it's supposed to, it's more about trying to figure out a logical solution to the simple question of drawing in a way that's invisible to the user. Quote Link to comment Share on other sites More sharing options...
lihis Posted October 14, 2017 Share Posted October 14, 2017 How about setting the alpha property to 0? No idea if it works but maybe worth a shot if you haven't tried already. Quote Link to comment Share on other sites More sharing options...
royibernthal Posted October 15, 2017 Author Share Posted October 15, 2017 I feel stupid now, can't believe I missed it. Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.