Can't get Grid sizing scopes to work in FuncUI
I've made a sample repo at https://github.com/marklam/GridSizingScopes
The sample code from https://docs.avaloniaui.net/docs/reference/controls/grid/sharedsizegroup is replicated in F# in the XamlGrids project.
An attempt to recreate this in FuncUI is in the FuncUIGrids project.
The XamlGrids version sizes the groups A, B and C (columns 1, 2 and 4) to their content. The FuncUI version sizes all the columns as if they were of width 1*
XamlGrids:
FuncUIGrids:
Is there something I'm missing? It doesn't seem like this should be object graph / diff related, but I'm not sure.
Hey @marklam
interesting bug, after looking at it briefly I don't not see anything obvious. Can take a closer look tomorrow
XAML Version:
FuncUI Version:
Thanks for taking the time to look at it.
Yes, the diagnostics view doesn't give much insight into size scopes, unfortunately.
I pushed a new changeset to make the UI trees match (ItemsControl with ContentPresenter instead of ListBox with ListBoxItem/HostControl) but it doesn't change the sizing.
Hey @marklam
Did you manage to make any progress by yourself?
No luck sadly, @JaggerJo
I had hoed that it was down to the layout hierarchy, but when that didn't fix it, I ended up just picking an adequate-looking fixed size as a workaround.
@marklam
I'm currently pretty time constrained.. I think this needs a full day of attention as it's not obvious why the exact same layout leads to different behaviour. SharedSizeScope seems to be not heavily used, I can image it containing some edge cases.
Would be interesting if the issue still exists if you create the UI tree in code (not FuncUI, raw F#/C#). Then we could isolate if it's XAML magic that's making it, or FuncUI breaking it 🙃
Based in what I had to do for Fabulous.Avalonia to support this. I think the logic for Row and Column definitions needs to be updated .
Context: https://github.com/fabulous-dev/Fabulous.Avalonia/pull/273/files
Hey @edgarfgp 👋
hmm, @marklam also sets SharedSizeGroup columns, see:
https://github.com/marklam/GridSizingScopes/blob/51619b3a6e2ffabedc66985ac8c3c7cb4ea657a6/FuncUIGrids/Program.fs#L42-L47
What am I missing here?