我正在尝试向扩展器添加一些内容,但是它会引发以下错误
<Expander Name="myExpander" Background="Tan"
HorizontalAlignment="Left" Header="my expander"
ExpandDirection="Down" IsEnabled="True" Width="100" IsExpanded="True">
<Rectangle Width="10" Height="10" Fill="Red"/>
<Rectangle Width="10" Height="10" Fill="blue"/>
</Expander>
对象“扩展器”已有子对象,无法添加“矩形”。'Expander' 只能接受一个孩子。
我以为我可以将 Expander 用作容纳少量元素的容器,但它似乎只能容纳一个!有什么解决方法吗?
谢谢你。阿米特