Is there a way I can have an object take up multiple grids in Windows UA?

前端 未结 1 988
野性不改
野性不改 2021-01-29 01:39

I\'m trying to make my first app, and I\'m having a little trouble with the grids. I\'m trying to make the left side of the screen a map, and the right side 2 boxes/grids. I\'m

相关标签:
1条回答
  • 2021-01-29 02:28

    You can't make an element "take up" multiple grids but you can make it span multiple cells by setting Grid.RowSpan or Grid.ColumnSpan as appropriate.

    e.g.

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height= "*"/>
            <RowDefinition Height= "*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
    
        <!-- Map will take up left hand side -->    
        <Map Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" />
    
        <!-- top right -->
        <Button Content="+" Grid.Column="1" Grid.Row="0" /> 
    
        <!-- bottom right -->
        <List Grid.Column="1" Grid.Row="1" /> 
    
    </Grid>
    
    0 讨论(0)
提交回复
热议问题