如何更改 listpicker 下拉 ItemTemplate 背景?

How to change listpicker dropdown ItemTemplate background?

我有一个 Windows Phone 8 列表选择器,我正在尝试更改其背景颜色,但是,它似乎只更改了项目背景,而不是像您一样更改下拉框背景可以在截屏中看到。下拉框似乎绑定了 WP8 主题。如何更改整个下拉框的背景,而不仅仅是每个单独的项目?

<toolkit:ListPicker x:Name="BackgroundListPicker" Background="Black" ItemsSource="{Binding BackgroundsList}">
<toolkit:ListPicker.ItemTemplate >
    <DataTemplate x:Name="BackgroundItemTemplate"  >
       <Grid HorizontalAlignment="Stretch" Background="Black" VerticalAlignment="Stretch" Margin="0,0,0,0">
         <StackPanel Orientation="Horizontal">
             <Image  Source="{Binding BackgroundThumb}" Width="30" Height="30" HorizontalAlignment="Left" />
             <TextBlock Text="{Binding BackgroundName}" Foreground="White"  Margin="12,0,0,0" HorizontalAlignment="Right"/>
         </StackPanel>
       </Grid>
   </DataTemplate>
  </toolkit:ListPicker.ItemTemplate>
 </toolkit:ListPicker>

所以你的问题是你试图将图像应用于项目。当您需要点击控件本身时,项目通过 ItemsPresenter 填充,因此通过拉出控件的默认样式模板,并为实例创建一个传递图像的位置,或者直接将一个放入模板本身。您得到的 ListPicker 背景的结果背景图像落后于填充它的项目。

很高兴您找到了补救措施!干杯。