开发者

WPF Logical Tree - bottom up vs. top down

开发者 https://www.devze.com 2022-12-21 09:51 出处:网络
I\'ve read the MSDN article about the layouts pass, that states: When a node is added or removed fro开发者_开发问答m the logical tree, property invalidations are raised on the node\'s parent and all

I've read the MSDN article about the layouts pass, that states:

When a node is added or removed fro开发者_开发问答m the logical tree, property invalidations are raised on the node's parent and all its children. As a result, a top-down construction pattern should always be followed to avoid the cost of unnecessary invalidations on nodes that have already been validated.

Now lets assume I do this. Won't the users see the control tree populate itself and the layout change several times during the control creation process? I want the whole control tree to just appear completely full.

Thanks!


Adding a visual is done on the UI thread. While you are constructing your scene the UI isn't being updated. As long as all of the control tree is added at once, opposed to using a Dispatcher or Background worker to add them over time, the user won't see each control being added.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号