-
|
Suppose that we have a control with a main Panel, which in turn contains "other panels and grids", which contain the "functional controls" the user actually interacts with. The layout of this main Panel needs to be changed during run-time from code-behind, which involves removing the children "functional controls" from their current place in the visual tree, removing/re-organizing the "other panels and grids", and finally re-inserting the "functional controls" to their new places. This results in a brief "flash" in the UI as a result of a finite time needed for the reorganization and re-insertion to take place. Is it possible to temporarily pause UI updates in Avalonia, and resume them only once all controls and their "parent-child" relationships are reorganized? Thanks! EDIT: I'm new to Avalonia, so it's entirely possible my approach to this question is not optimal, and what I'm seeking to achieve can be achieved in different ways. Any insights will be helpful! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Avalonia will not re-render UI nor re-layout UI on every change to the tree. It will schedule a dispatcher job to do it on the next event loop tick. I would say, you should profile your project to see which parts exactly are slow and start from there. |
Beta Was this translation helpful? Give feedback.
Avalonia will not re-render UI nor re-layout UI on every change to the tree. It will schedule a dispatcher job to do it on the next event loop tick.
Saying this, updating visual/logical tree by itself might be a slower task, especially if any controls have a heavy event handler for that process.
I would say, you should profile your project to see which parts exactly are slow and start from there.