Silverlight 中 Expander 的列表框无法正确折叠
我在 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>
I have a listbox of expanders in Silverlight. They expand fine, however, when they collapse, the stackpanel containing the expander does not minimize. I have attached a screenshot here.
<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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论