I created a UserControl that extends ComboBox functionality in interesting and useful ways. It looks like this when it fell:

I created a whole bunch of functions in the control, and they all work smoothly. It makes me think that I have something that I do. You would think that it would be a trivial matter for the UserControl style to set the TextBox editable text brush. In fact, it seems that this is simply impossible. And I am puzzled.
UserControl XAML, extremely abbreviated (thank you for that), looks like this:
<UserControl x:Class="MyApp.CodeLookupBox" x:Name="MainControl">
<UserControl.Resources>
<UserControl.Resources>
<ComboBox x:Name="ComboBox"
Margin="0"
Style="{DynamicResource ComboBoxStyle1}"
VerticalAlignment="Top"
ItemTemplate="{StaticResource GridViewStyleTemplate}"/>
</UserControl>
There is a lot of code in this element, mostly dependency properties, which I use for things like selecting the template that was used in the drop-down list.
, . , - , XAML, :
<Style TargetType="{x:Type local:CodeLookupBox}">
<Style.Triggers>
<DataTrigger Binding="{Binding IsRequired}" Value="True">
<Setter Property="EditableTextBoxBackground" Value="{StaticResource RequiredFieldBrush}"/>
</DataTrigger>
</Style.Triggers>
</Style>
UserControl, TextBox. TextBox .
ComboBox , TextBox:
<Style x:Key="ComboBoxEditableTextBox" TargetType="{x:Type TextBox}">
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="AllowDrop" Value="true"/>
<Setter Property="MinWidth" Value="0"/>
<Setter Property="MinHeight" Value="0"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<ScrollViewer
x:Name="PART_ContentHost"
Focusable="false"
HorizontalScrollBarVisibility="Hidden"
VerticalScrollBarVisibility="Hidden"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
TextBox ( ComboBox) :
<TextBox
x:Name="PART_EditableTextBox"
Margin="{TemplateBinding Padding}"
Style="{StaticResource ComboBoxEditableTextBox}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}"/>
, ComboBoxEditableTextBox. ScrollViewer? . , , TextBox ControlTemplate, .
: TextBox Background , . Background PART_EditableTextBox, . ( Foreground FontFamily, .)
Background ScrollViewer Green, , voila, TextBox .
, TextBox . , , , . ScrollViewer, , TextBox. , .
, TextBox Background, ScrollViewer. , , EditableTextBoxBackground? , PropertyChanged . ScrollViewer XAML :
Background="{Binding ElementName=MainControl,
Path=EditableTextBoxBackground,
Converter={StaticResource DebuggingConverter}}"
. , . null. . UserControl, .
, : UserControl . TextBox UserControl. ScrollViewer TextBox . PropertyChanged , , ScrollViewer Background.
.
, : 1) ? 2) , , ScrollViewer , ? , , . 3) Blend , , ?
, .