Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/305.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# 使用XAML收缩和扩展其他扩展器时移动扩展器_C#_Wpf_Xaml - Fatal编程技术网

C# 使用XAML收缩和扩展其他扩展器时移动扩展器

C# 使用XAML收缩和扩展其他扩展器时移动扩展器,c#,wpf,xaml,C#,Wpf,Xaml,我有一个堆叠面板,里面有两个扩展器: <Grid x:Name="LayoutRoot" Margin="0"> <StackPanel Height="Auto" Margin="0" Width="Auto"> <Expander Header="my expander" Height="200" Margin="0,0,0,0" Width="Auto" Background="#00F19494" VerticalAlignment

我有一个堆叠面板,里面有两个扩展器:

<Grid x:Name="LayoutRoot" Margin="0">
    <StackPanel Height="Auto" Margin="0" Width="Auto">
        <Expander Header="my expander"  Height="200" Margin="0,0,0,0" Width="Auto" Background="#00F19494" VerticalAlignment="Top">
            <Grid Background="#FFB86E6E"/>
        </Expander>
        <Expander Header="next expander"  Height="200" Margin="0,0,0,0" Width="Auto" Background="#00F19494" VerticalAlignment="Top">
            <Grid Background="#FF6E5C5C"/>
        </Expander>
    </StackPanel>
</Grid>

我希望第二个扩展器在第一个扩展器收缩时向上移动,在第一个扩展器膨胀时向下移动,所以它总是出现在第二个扩展器区域的底部


使用XAML有没有一种简单的方法?

您是否尝试过从扩展器中删除
高度
,然后将其添加到扩展器内部的网格中?@Arsen您是否设法解决了这个问题?