设置全景项目列表背景图像

时间:2011-10-31 10:33:53

标签: c# silverlight windows-phone-7 panorama-control

如何为panoramaItem的ListBox设置背景图像?

我有这个全景项目:

 <controls:PanoramaItem Header="Shopping list"  >

<ListBox x:Name="List"  ItemsSource="{Binding rList}"  ItemTemplate="{StaticResource ListViewModelTemplate}"  >
</ListBox>

</controls:PanoramaItem>

并希望将图像作为此列表项的背景(笔记本图像)。我怎么能这样做?

1 个答案:

答案 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>