如何为panoramaItem的ListBox设置背景图像?
我有这个全景项目:
<controls:PanoramaItem Header="Shopping list" >
<ListBox x:Name="List" ItemsSource="{Binding rList}" ItemTemplate="{StaticResource ListViewModelTemplate}" >
</ListBox>
</controls:PanoramaItem>
并希望将图像作为此列表项的背景(笔记本图像)。我怎么能这样做?
答案 0 :(得分:1)
您只需要像这样设置ListBox's
Background
,
<ListBox x:Name="List" ItemsSource="{Binding rList}" ItemTemplate="{StaticResource ListViewModelTemplate}">
<ListBox.Background>
<ImageBrush Stretch="Fill" ImageSource="PanoramaBackground.png"/>
</ListBox.Background>