First of all, I'd like to apologize if I fail to comply with any SO rules, as it's my first question.
What I'm trying to acomplish, is having a square gridLayout in my page. The behavior should be equivalent to having an element with stretch="aspectFit".
If the suggested solution could let me enforce any given aspect ratio instead of just a square one, it would be a nice plus, because it would allow me to solve multiple situations in the future. Or if it could be applied to any Layout element, it would also be nice.
The solution can be as hacky as desired, and the GridLayout can be nested in any way you need to acomplish this.
I have already tried to hack it like this:
<GridLayout rows="*,auto,*" columns="*,auto,*" backgroundColor="green">
<Image row="1" col="1" src="~/Images/1px-black.png" stretch="aspectFit" width="100%"></Image>
<StackLayout row="1" col="1" orientation="vertical" backgroundColor="lightgray">
<Label text="Label 1" width="100%" height="25%" backgroundColor="red"></Label>
<Label text="Label 2" width="100%" height="25%" backgroundColor="green"></Label>
<Label text="Label 3" width="100%" height="25%" backgroundColor="blue"></Label>
<Label text="Label 4" width="100%" height="25%" backgroundColor="yellow"></Label>
</StackLayout>
</GridLayout>
Visually it seemed to work, but the contents of the GridLayout didn't fill it apropriately
PS: I just noticed in the example I chose, the layout element I am trying to make square is the nested StackLayout, but it's the same idea. I need a way to make a nested layout element squared.