I have set my ListBox.ItemTemplate
to something like below
我将ListBox.ItemTemplate设置为如下所示
<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
?
如何使StackPanel填充ListBox的整个宽度?
1 个解决方案
#1
5
Off the top of my head, Set the HorizontalContentAlignment property of the Listbox to Stretch.
在我的头顶,将Listbox的HorizontalContentAlignment属性设置为Stretch。
#1
5
Off the top of my head, Set the HorizontalContentAlignment property of the Listbox to Stretch.
在我的头顶,将Listbox的HorizontalContentAlignment属性设置为Stretch。