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
WPF扩展器在画布内时不会向上扩展?_Wpf_Wpf Controls_Expander - Fatal编程技术网

WPF扩展器在画布内时不会向上扩展?

WPF扩展器在画布内时不会向上扩展?,wpf,wpf-controls,expander,Wpf,Wpf Controls,Expander,我有一个位于画布中的扩展器,想将其向上扩展,但当它打开时,切换按钮会向下移动。问题出在哪里,这是我的代码: <Canvas Grid.Row="0" Panel.ZIndex="99" Width="20" Height="20" > <Expander HorizontalAlignment="Left" VerticalAlignment="Bottom"

我有一个位于画布中的扩展器,想将其向上扩展,但当它打开时,切换按钮会向下移动。问题出在哪里,这是我的代码:

  <Canvas Grid.Row="0" Panel.ZIndex="99"  Width="20" Height="20" >
            <Expander
                HorizontalAlignment="Left" 
                VerticalAlignment="Bottom"
                ExpandDirection="Up">
                <Grid>
                    <Button x:Name="btn1" Content="hhhh" Height="200" ></Button>
                </Grid>
            </Expander>
        </Canvas>

将ExpandDirection更改为Down,这样您要显示的内容将显示在expander按钮下方,而不是上方。

@Dave:谢谢,但我希望这些内容显示在expander按钮上方!谢谢,但我以前见过,这不是我需要的。