GithubHelp home page GithubHelp logo

Comments (3)

github-actions avatar github-actions commented on June 15, 2024

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:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

from microsoft-ui-xaml.

kmgallahan avatar kmgallahan commented on June 15, 2024

Per the Star sizing documentation:

https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.gridlength?view=windows-app-sdk-1.5#star-sizing

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.

CTimet avatar CTimet commented on June 15, 2024

Ok I got it

from microsoft-ui-xaml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.