WPF-like GRID structure.

Hello, I have been trying to no avail to implement in my own framework for a project, a structure that behaves similar to the WPF grid. That said, I failed miserably and can't seem to produce a Algorithm that fits my needs.

My questions relates to what happens when the grid is inside a Container that passes as its Size a PositiveInfinity to Width/Height and the grid has Star Columns/Rows. My current implementation makes the grid take the full Size, resulting in a infinite grid.


I know that when PositiveInf is passed it means, size to contents, but how do I size a Star Column/Row to fit its contents, specially when the contents span 2 or more rows/cols? I am not even using AUTO columns, since I thought that it would be overcomplicated.

I honestly don't care if the algorithm is the best algorithm to solve this issue, I just want to be able to understand it, I tried looking into WPF source, but I can't for the sake understand whats there.

this SO question has a better explanation and code samples of what I have SO Link

by Morphexe via /r/csharp

Leave a Reply