我具有以下设置,您可以在此处查看
<ListView>
<ListViewItem x:Name="ItemHome" Height="60">
<ListViewItem.Content>
<StackPanel Orientation="Horizontal">
<materialDesign:PackIcon
Width="25"
Height="25"
Margin="10"
VerticalAlignment="Center"
Kind="Database" />
<Expander
VerticalAlignment="Center"
Background="{x:Null}"
FontFamily="20"
Header="TEST">
<Expander.Content>
<StackPanel Background="Green" Orientation="Vertical">
<ListViewItem Height="60">
<StackPanel Orientation="Horizontal">
<materialDesign:PackIcon
Width="25"
Height="25"
Margin="10"
VerticalAlignment="Center"
Kind="Octagon" />
<TextBlock
Margin="20,10"
VerticalAlignment="Center"
FontFamily="20"
Text="TEST" />
</StackPanel>
</ListViewItem>
<ListViewItem Height="60">
<StackPanel Orientation="Horizontal">
<materialDesign:PackIcon
Width="25"
Height="25"
Margin="10"
VerticalAlignment="Center"
Kind="Needle" />
<TextBlock
Margin="20,10"
VerticalAlignment="Center"
FontFamily="20"
Text="TEST" />
</StackPanel>
</ListViewItem>
</StackPanel>
</Expander.Content>
</Expander>
</StackPanel>
</ListViewItem.Content>
</ListViewItem>
</ListView>
问题是我相信我以某种方式弄乱了代码,因为当我按下扩展按钮时,什么都没有显示。尝试给扩展器内容指定高度/宽度,但没有运气。扩展器按钮显示他已扩展,但仅此而已。有任何想法吗?谢谢