ListBoxItem宽度不能自适应
There is a bug in the CTP version of ListBoxItem template that doesn't honour the "Stretch" property. What you want is add something like this to your ListBox to make the items stretch:
<ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem"> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <ContentPresenter HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/> </ControlTemplate> </Setter.Value> </Setter> </Style> </ListBox.ItemContainerStyle>
This is fixed in the latest internal builds.