Comments (3)
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you!
Open similar issues:
- UniformGridLayout and ItemsRepeater doesn't correctly size for second item (#7173), similarity score: 0.71
- Grid RowDefinitions/ColumnDefinitions not recognized by VS2022 (#6370), similarity score: 0.70
- Grid ColumnSpacing and RowSpacing lost (#9367), similarity score: 0.70
Closed similar issues:
- Grid: RowDefinition's MaxHeight is not working when placed in a StackPanel (#4887), similarity score: 0.79
- ItemsStackPanel extends beyond containing Grid (#1876), similarity score: 0.71
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
from microsoft-ui-xaml.
Per the Star sizing documentation:
Star sizing is a convention whereby a GridLength has a number value that specifies a weighted factor versus other GridLength values. Any GridLength values that use star sizing divide the available space, accounting for the weighting factors, and evaluating after any fixed widths are applied.
Per documentation on StackPanel usage:
https://learn.microsoft.com/en-us/windows/apps/design/layout/layouts-with-xaml#layout-panels
Stretch values for HorizontalAlignment/VerticalAlignment are respected in the direction opposite the Orientation property. If an element's size is not set explicitly, it stretches to fill the available width (or height if the Orientation is Horizontal). In the direction specified by the Orientation property, an element sizes to its content.
StackPanel.Orientation default value is Vertical. So your Grid is being vertically sized to its content in the StackPanel, which is nothing, so the Grid asks for and receives no vertical space from the StackPanel during layout, so the star sizing has no available space to divide up, hence the rows have no height.
If you give the Grid some amount of Height or provide content that asks for some amount of Height, then the StackPanel will provide said height and star sizing will have something to work with. Note that content in a single row requesting Height of 400 means the grid asks its parent for 400 Height, gets it, uses it for that row, and the stars are still left with nothing to work with.
A Grid inside a Grid asks for a whatever vertical Stretching will provide (the default value for Height), and the parent Grid is also asking to Stretch, so it gets the full Height, provides the Height to the child Grid, and the child grid uses said Height to divide amongst the Star sized rows after fixed height rows are accounted for.
from microsoft-ui-xaml.
Ok I got it
from microsoft-ui-xaml.
Related Issues (20)
- Enabling NumberBox AcceptsExpression ignores numbers smaller than 1 when entered in scientific notation HOT 3
- Expanders need a button on the arrow to assist with the narrator. HOT 2
- WinUI 3 ContentDialog declaration in xaml as Flyout does HOT 1
- ListView doesn't respect Visibility of contents HOT 4
- Able to change the window height even if IsResizable is false but ExtendsContentIntoTitleBar is true HOT 2
- AOT fails with Dictionary<T, U> in 1.6 Experimental HOT 1
- DefaultTitleBarShouldMatchAppModeTheme does not respect RequestedTheme HOT 1
- ContentDialog has no show animation in 1.6-exp1 HOT 3
- `NumberBox` different visuals in 1.6-exp1 HOT 1
- ElementName bindings deeper in ItemsRepeater.ItemTemplate don't work HOT 8
- Unexpected results when nesting binding to ItemsControl HOT 3
- Default drag UI tooltip is not per monitor dpi aware HOT 1
- NavigationView Touch Artifact HOT 1
- `TryUnboxPropertyValue` should handle enums
- When changing the application theme using RequestedTheme, the colors of the toolbar buttons in the TitleBar do not change properly. HOT 1
- The default context selection menu of the control does not have an icon HOT 1
- TimePicker and DatePicker unreasonable positioning HOT 2
- Only two project references can be added to a winui3 desktop application HOT 2
- AnnoatatedScrollBar tooltip not dismissing HOT 1
- "1.5.4" x64 download link is broken HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from microsoft-ui-xaml.