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)
- Taskbar will not show when the window maximized in Windows 10 HOT 2
- Can not Build Project due to error message APPX110 Payload contains two or more files with the same destination path '.pdb'. HOT 3
- ItemsRepeater inside a ScrollViewer with odd behaviour when it changes size HOT 3
- Is IScrollSnapPointsInfo expected to work with ScrollView?
- Proposal: Markup extension executed at compile time
- Tooltip showing behind inactive window HOT 5
- WinUI 3 SelectorBar Rendering Bug After Adding CommunityToolkit.WinUI.Controls.SettingsControls Package HOT 5
- Unhandled exception when using an icon as a resource HOT 3
- How to generate the smallest possible publishing file for unpackaged Winui3 app? HOT 4
- ListView Crashes if GetContainerForItemOverride Returns a Container Not Derived from SelectorItem HOT 1
- ToolTipService.Placement="Right" the tooltip will hide the spin buttons of a NumberBox HOT 8
- HyperlinkButton Accessibility control type cannot be overridden HOT 1
- Proposal:AppWindow.IsResizable = false;
- Tooltips of Minimize, Maximize/Restore & Close window buttons are missing HOT 1
- CPP TeachingTip Crashγ HOT 2
- TeachingTip is not read by Windows Accessibility Narrator when IsLightDismissEnabled=True HOT 1
- Repeatedly updating explicit `Width` property causes frame drops HOT 4
- Possible leak in RefreshContainer where it doesn't stop a "Forever" composition animation HOT 4
- WinUI 3 App - InitializeComponent Fails with WinRT Error and TypeInitializationException HOT 4
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.