WPD layout elements

Source: Internet
Author: User

    • Grid

  The grid lays out the content elements in the form of a grid, with the following characteristics:

    1. Can define any number of rows and columns, very flexible;
    2. The height of the row and the width of the column can be precisely set using absolute values, relative proportions, or automatic adjustments, and the maximum and minimum values can be set;
    3. Internal elements can set their own rows and columns, you can also set their own vertical span of several lines, across several columns horizontally;
    4. You can set the alignment direction of the children element.

Grid usage scenarios are:

    1. Large frame design of UI layout;
    2. A large number of UI elements that require rows or columns to align;
    3. When the overall UI size changes, the element needs to maintain the inherent height and width ratio;
    4. There may be large changes or extensions to the UI later.

  Define Grid

the grid has ColumnDefinitions and rowdefinitions two attributes to define columns and rows, with the following code:   

<Grid>        <Grid.ColumnDefinitions>            <ColumnDefinition/>            <ColumnDefinition/>        </Grid.ColumnDefinitions>        <Grid.RowDefinitions>            <RowDefinition/>            < rowdefinition/>            <RowDefinition/>        </Grid.RowDefinitions>    </Grid>
View Code

It can also be added dynamically by code, as follows:

This. MYGRID.ROWDEFINITIONS.ADD (New RowDefinition ()); MYGRID.COLUMNDEFINITIONS.ADD (New ColumnDefinition ());
View Code

    • StackPanel

    • DockPanel

    • Canves

    • Wraperpanel

WPD layout elements

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.