Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 浮动面板(与对齐重叠)_C#_Wpf - Fatal编程技术网

C# 浮动面板(与对齐重叠)

C# 浮动面板(与对齐重叠),c#,wpf,C#,Wpf,是否有可能在wpf中的面板中浮动(与对齐重叠)子对象。 我有4个相互重叠的按钮。它们需要左、右、上、下对齐,并与父容器一起增长。请查看图片以了解更多信息 这个怎么样 <Grid> <Grid> <Grid.RowDefinitions> <RowDefinition Height="1*"/> <RowDefinition Height="2*"/>

是否有可能在wpf中的面板中浮动(与对齐重叠)子对象。 我有4个相互重叠的按钮。它们需要左、右、上、下对齐,并与父容器一起增长。请查看图片以了解更多信息

这个怎么样

<Grid>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="1*"/>
            <RowDefinition Height="2*"/>
            <RowDefinition Height="1*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>

        <Button Grid.Row="1" Grid.Column="0" Content="Left"/>
        <Button Grid.Row="1" Grid.Column="1" Content="Right"/>
    </Grid>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="2*"/>
            <ColumnDefinition Width="1*"/>
        </Grid.ColumnDefinitions>

        <Button Grid.Row="0" Grid.Column="1" Content="Top"/>
        <Button Grid.Row="1" Grid.Column="1" Content="Bottom"/>
    </Grid>
</Grid>

导致