我想使用列表框创建歌曲列表,但布局有问题。
目前我使用以下xaml:
<ListBox x:Name="lstHistory" HorizontalAlignment="Stretch" Margin="12,284,0,90" Width="460">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
<StackPanel Orientation="Horizontal">
<Image Margin="5" VerticalAlignment="top" Source="{Binding Image}" />
</StackPanel>
<StackPanel Orientation="Vertical" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<TextBlock Margin="8"
TextWrapping="Wrap"
VerticalAlignment="Top"
HorizontalAlignment="Left"
Text="{Binding Name}" />
<TextBlock Margin="8"
VerticalAlignment="Top"
HorizontalAlignment="Left"
Text="{Binding Artist}" />
<TextBlock Margin="8,0,8,8"
VerticalAlignment="Bottom"
HorizontalAlignment="Right" Text="{Binding Time}" Opacity="0.25" />
</StackPanel>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
我想把时间放在列表项的最右下角,但每次它都会出现在屏幕中间。
这是我得到的一个例子:
谁能告诉我怎么去那里的时间?