-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grid cells do not fill the page #1259
Comments
@mobynet1 could you tell if this issue happens on the net8.0-windows head? |
@jeromelaban This happens on WinAppSDK Unpackaged as well as Desktop. I think I've put my finger on the issue and it points to the AutoLayout. This works:
which produces: And this does not work:
Which produces this: The only difference between the two is the latter is wrapped inside the AutoLayout control. Is it in the way that I am using the AutoLayout control? Here, I am not using any properties to the control, but believe me, I have tried almost every property in almost every combination and it just misbehaves... |
Cc @kazo0 |
Setting the Primary/Counter Alignments on the Grid through the AutoLayout AttachedProperties should do the trick: <utu:AutoLayout>
<Grid utu:AutoLayout.PrimaryAlignment="Stretch" utu:AutoLayout.CounterAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*" />
<ColumnDefinition Width="5*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="2*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border Background="#2f5cb6" />
<Border Grid.Column="1"
Background="#1f3d7a" />
<Border Grid.Row="1"
Grid.ColumnSpan="2"
Background="#152951" />
</Grid>
</utu:AutoLayout> Although, I would have thought that setting the I have transferred this issue to the Toolkit repo so we can investigate |
I have been a WPF developer since 2006 and have written thousands of lines of WPF xaml code without issue. Maui, because Mirocosoft has to have a billion different versions of xaml, made me learn YAXL (yet another Xaml language), but I figured it out. Then, here comes Uno which uses WinUI 3... I am probably needing to quit my day job and go be a greeter at Walmart because I just cannot figure this out.
I am doing a poor-man's version of navitation. I have a list view with cells, that when selected, set the content of a content control on the main page to the page that was selected.
This is the definition of the main page:
I have a SelectionChanged event handler in the Main.xaml.cs code-behind that handles the page set up. It works fine as the pages change as I need them to. But... for the life of me, I cannot get any page that is loaded as the content of the content control to consume the entire page surface. I have tried using AutoLayout, but that didn't work as I could get two out of three columns to fill properly, but I could never get all three columns to fill. When I added a listview to the third column, suddenly all of the column's vertical height get set to the tallest column but it was still shorter than the panel height. I tried changing the type of the content being loaded into the content control to UserControl, but that didn't fix it.
This is the abbreviated code of a page I am trying to load:
It just ends up looking like this:
If I change the MainPage to this:
I get this, which is what I want:
What is it about a page that is being loaded into a content control on the main page does not render the same way it renders the main page does when that is all the xaml tells it to do???
I know this is something extremely simple, but I have spent hours and tried a million things to make this work. My bet is that if one of you smart guys that reads this you will see the error immediately. I just can't look at it any longer!!!
Originally posted by @mobynet1 in unoplatform/uno#18221
The text was updated successfully, but these errors were encountered: