Combobox在顶部选择项目背景而不是弹出窗口

时间:2012-11-10 16:03:20

标签: c# wpf

我正在寻找一种在那里设置图像背景的方法..因为它在灰色背景上是白色的。所选项目触发器不起作用,因为没有父ComboboxItem ..

enter image description here

      <ComboBox.Resources>
                <DataTemplate x:Key="DataTemplate1">
                    <Border x:Name="border"  Padding="10">
                        <Image  Source="{Binding }" Stretch="None"/>
                    </Border>
                </DataTemplate>
                <ItemsPanelTemplate x:Key="ItemsPanelTemplate1">
                    <WrapPanel  Width="{Binding ActualWidth , RelativeSource={RelativeSource Mode=FindAncestor, 
                             AncestorType={x:Type ComboBox }}}"  Background="{StaticResource ListItemSelected}"  Orientation="Horizontal"   IsItemsHost="True"/>
                </ItemsPanelTemplate>
            </ComboBox.Resources>

0 个答案:

没有答案
相关问题