我在Silverlight中有一个扩展器列表框。它们会很好地膨胀,但是当它们坍塌时,包含膨胀机的堆叠板不会最小化。我在这里附上了截图。
<Grid Background="White">
<StackPanel Orientation="Vertical" Margin="5,5,5,5" Grid.Column="0" MinWidth="700">
<controls:Expander Expanded="Expander_Expanded" Name="expander1" Margin="5,0,0,5" Header="{Binding Name}" HorizontalAlignment="Stretch" FontSize="15" FontFamily="Arial" FontWeight="Black" Height="Auto" >
<StackPanel>
<ListBox Height="Auto" Width="Auto" ItemsSource="{Binding ProductStreamCollection}" SelectionChanged="ListBox_SelectionChanged" MinWidth="700">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<view:StreamView/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
</controls:Expander>
</StackPanel>
</Grid>