如何将列表视图的宽度设置为与它所在的扩展器的宽度相同?
<Expander x:Name="expander"
IsExpanded="False"
ExpandDirection="Down"
Header="Main"
HorizontalAlignment="Stretch"
Grid.Column="1"
Grid.Row="1">
<Expander.Content>
<ListView x:Name="listView"
SelectionMode="None"
IsItemClickEnabled="True"
HorizontalAlignment="Stretch"
ItemClick="ListItemClicked"
ItemTemplate="{StaticResource ListViewTemplate}"/>
</Expander.Content>
</Expander>
1条答案
按热度按时间vuv7lop31#
像这样将
HorizontalContentAligment="Stretch"
加到Expander
上。