AutoCompleteBox change TextBox style does not working?

Jun 27, 2011 at 7:00 PM
Edited Jun 27, 2011 at 7:00 PM

I tried to set TextBoxStyle to my style, but the textbox is still white background and black foreground -  It is working if I set the Background and Foregroud , but not when setting the textBoxStyle.

    <Style x:Key="Style_AutoCompleteBoxTextBox" TargetType="TextBox">
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="BorderBrush" Value="White"/>
            <Setter Property="Background" Value="Navy"/>
            <Setter Property="Padding" Value="2,1"/>
            <Setter Property="FontFamily" Value="Verdana"/>
            <Setter Property="FontSize" Value="12"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="Foreground" Value="White"/>

  </Style>

 

 

    <acb:AutoCompleteBox x:Name="acbTest" 
                                 VerticalAlignment="Top"
                                 Height="24"
                                 ValueMemberPath="Name" 
                                IsTextCompletionEnabled="True"
                               Margin="0"
                               TextBoxStyle="{StaticResource Style_AutoCompleteBoxTextBox}"
                             MinimumPrefixLength="0"
                             MinimumPopulateDelay="500"
                             FilterMode="None"
                            >
                <acb:AutoCompleteBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding Name}" Foreground="Black"/>
                        </StackPanel>
                    </DataTemplate>

                </acb:AutoCompleteBox.ItemTemplate>

            </acb:AutoCompleteBox>

 

 

What did I do wrong

Thanks for any help

-rockdale