我正试图设立一个扩大小组,由该负责人固定下来,其内容出现在上面任何其它控制线上。 <>ExpandDirection=“Up”,并将扩大成员放在Canvas实现其中一半的目标——内容比头部扩大,并超出其他控制(尽管下文),但头部向下移动。
是否有办法这样做,但还是要让头脑处于固定的位置,以便内容能够结束上述过度控制?
这是我迄今为止所阐明的:
<Window x:Class="Sandbox.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="900" Width="1100">
<StackPanel>
<StackPanel Margin="20,0,0,0">
<RadioButton Content="Choice One"/>
<RadioButton Content="Choice Two"/>
<RadioButton Content="Choice Three"/>
<RadioButton Content="Choice Four"/>
<RadioButton Content="Choice Five"/>
<RadioButton Content="Choice Six"/>
</StackPanel>
<Canvas MinHeight="25" Panel.ZIndex="99">
<Expander Header="This must stay fixed" ExpandDirection="Up" Width="175">
<Grid Background="Cornsilk">
<Grid.BitmapEffect>
<DropShadowBitmapEffect />
</Grid.BitmapEffect>
<TextBlock TextWrapping="Wrap" Margin="5">
This must expand upwards, not downwards.
The header must remain exactly where it is.
This TextBlock must appear above the header
and overlay the top radio buttons instead.
</TextBlock>
</Grid>
</Expander>
</Canvas>
<StackPanel Margin="20,0,0,0">
<RadioButton Content="Choice One"/>
<RadioButton Content="Choice Two"/>
<RadioButton Content="Choice Three"/>
<RadioButton Content="Choice Four"/>
<RadioButton Content="Choice Five"/>
<RadioButton Content="Choice Six"/>
</StackPanel>
</StackPanel>
</Window>