Fix/document layout system #15078
Replies: 4 comments 10 replies
-
An example of such a layout experiencing this issue: I want a control to rearrange itself based on whether its bounding box is wide or tall. So when the size of the object changes, I adjust Grid attached properties to place the inner layouts in different locations on the grid. But what I sometimes observe is either 1) the on-screen arrangement reflects the previous state, such that it renders tall when it should be wide and vice versa (if I only adjust when there are changes) or when I interact with the controls, triggering a fresh layout pass; or 2) the arrangement is just incorrect. Which of these occurs depends on when the base OnSizeAllocated is called. In another related example, the text labels in a nested control either do not fit inside their bounding box, or will end up infinitesimally thin because an intermediate resize cycle provided a narrow measure. |
Beta Was this translation helpful? Give feedback.
-
MAUI showed products working fantastically, however I suspect the framework it's tailored to their taste, their ways of making application so there's a lot assumptions in the framework potentially about what you are supposed to do. I recommend UI frame works stop making the assumptions for application developers, because we are creative people that's creating disruption in the industry therefore bringing new energy to the economy, wanting to be writing programes in whatever way we can There're a lot smart people who doesn't need to do things using the hundreds of features in the UI framework that's being maintained, what they needed was a framework that can render given dimension, location, styling, handling events, providing layering for elements created so they understand hierarchy and 'z-index' when handling a mouse click that's it and people can make their own framework abstracting a rectangle and then a button with material design etc |
Beta Was this translation helpful? Give feedback.
-
Developer-focused docs (still in progress) are here: https://github.com/dotnet/maui/blob/main/docs/design/layout.md Still some parts to write, and a few things that may need to be updated. If you find something in there that's confusing or doesn't answer questions, ping me so I can fill in the blanks. |
Beta Was this translation helpful? Give feedback.
-
So I tried this refactoring (in 7.0.81):
(Documenting how the Measure/ArrangeChildren overrides should interact with the base method would be useful.) Now this seems to mostly work. I had to move Drawable invalidations back into It seems like it is necessary to trigger a second layout pass with the same dimensions to obtain the correct appearance. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
One of my biggest pain points in making complex layouts in MAUI is that the result of the rendering pass leaves parts of the layout using measurements from an earlier pass. It's as if there's a missing rendering pass after the last measurement pass. I'm spending way too much time trying to finesse a way to make it work correctly. And I can't tell if I'm just not using the system correctly, violating some expectation, or if the system is broken.
I would like to see documentation for how the MAUI layout system works, and how custom layouts are expected to fit into this system.
Such documentation existed for WPF, such as here: https://learn.microsoft.com/en-us/dotnet/desktop/wpf/advanced/layout?view=netframeworkdesktop-4.8
Beta Was this translation helpful? Give feedback.
All reactions