0

如何为全景项目的 ListBox 设置背景图像?

我有这个全景项目:

 <controls:PanoramaItem Header="Shopping list"  >

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

</controls:PanoramaItem>

并希望有一个图像作为此列表项的背景(笔记本图像)。我该怎么做?

4

1 回答 1

1

你只需要这样设置ListBox's Background

            <ListBox x:Name="List" ItemsSource="{Binding rList}" ItemTemplate="{StaticResource ListViewModelTemplate}"> 
                <ListBox.Background>
                    <ImageBrush Stretch="Fill" ImageSource="PanoramaBackground.png"/>
                </ListBox.Background>
于 2011-10-31T10:54:49.620 回答