I have set my ListBox.ItemTemplate
to something like below
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Margin="10">
<TextBlock Text="{Binding Args}" />
<ProgressBar Value="{Binding Progress}" Height="10" />
<TextBlock Text="{Binding Status}" />
<TextBlock Text="{Binding Result}" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
The result is
How can I make the StackPanel
fill the entire width of the ListBox
?
在我的头顶,将Listbox的HorizontalContentAlignment属性设置为Stretch。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.