title: WPF Combobox Selected Item not visible
body: <p>In my WPF app UserControl I want to set the background of the combo box. After seeking lots of help and tutorials I could achieve it as expected, but now am not able to see the selected item in the text. I mean, the selected item could be seen in drop down, but not in combo box when any drop is not clicked. 
     I tried many variations to set the fore color of the text, but no success. Also tried thru different sites, but couldn't get everything workable. Am stuck badly since days on this. Below is my code. </p>
  
  <pre><code>    &lt;LinearGradientBrush x:Key="NormalBrush" StartPoint="0,0" EndPoint="0,1"&gt;
          &lt;GradientBrush.GradientStops&gt;
              &lt;GradientStopCollection&gt;
                  &lt;GradientStop Color="#106594" Offset="0.0"/&gt;
                  &lt;GradientStop Color="LightYellow" Offset="1.0"/&gt;
              &lt;/GradientStopCollection&gt;
          &lt;/GradientBrush.GradientStops&gt;
      &lt;/LinearGradientBrush&gt;
  
      &lt;SolidColorBrush x:Key="WindowBackgroundBrush" Color="#106594" /&gt;
  
      &lt;ControlTemplate x:Key="ComboBoxToggleButton" TargetType="ToggleButton"&gt;
          &lt;Grid&gt;
              &lt;Grid.ColumnDefinitions&gt;
                  &lt;ColumnDefinition /&gt;
                  &lt;ColumnDefinition Width="20" /&gt;
              &lt;/Grid.ColumnDefinitions&gt;
              &lt;Border x:Name="Border" Grid.ColumnSpan="2" CornerRadius="2"
                  Background="{StaticResource NormalBrush}" BorderThickness="1" /&gt;
              &lt;Border Grid.Column="0" CornerRadius="2,0,0,2" Margin="1" 
                  Background="{StaticResource WindowBackgroundBrush}" BorderThickness="0,0,1,0" /&gt;
              &lt;Path x:Name="Arrow" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"
                  Data="M 0 0 L 4 4 L 8 0 Z" Fill="Black"/&gt;
          &lt;/Grid&gt;
      &lt;/ControlTemplate&gt;
  
      &lt;ControlTemplate x:Key="ComboBoxTextBox" TargetType="TextBox"&gt;
          &lt;Border x:Name="PART_ContentHost" Focusable="False" Background="{TemplateBinding Background}"  /&gt;
      &lt;/ControlTemplate&gt;
  
      &lt;Style x:Key="{x:Type ComboBox}" TargetType="ComboBox"&gt;
          &lt;Setter Property="Template"&gt;
              &lt;Setter.Value&gt;
                  &lt;ControlTemplate TargetType="ComboBox"&gt;
                      &lt;Grid&gt;
                          &lt;ToggleButton Name="ToggleButton" Template="{StaticResource ComboBoxToggleButton}" 
                              Grid.Column="2" Focusable="false" 
                              IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
                              ClickMode="Press" &gt;
                          &lt;/ToggleButton&gt;
                          &lt;ContentPresenter Name="ContentSite" IsHitTestVisible="False" 
                              Margin="3,3,23,3" VerticalAlignment="Center" HorizontalAlignment="Left" /&gt;
                          &lt;TextBox x:Name="PART_EditableTextBox" Style="{x:Null}" 
                              Template="{StaticResource ComboBoxTextBox}" HorizontalAlignment="Left" 
                              VerticalAlignment="Center" Margin="3,3,23,3" Focusable="True" 
                              Background="Transparent" Foreground="{TemplateBinding Foreground}" Visibility="Hidden" 
                              IsReadOnly="{TemplateBinding IsReadOnly}"/&gt;
  
                          &lt;Popup  Name="Popup" Placement="Bottom" IsOpen="{TemplateBinding IsDropDownOpen}"
                              AllowsTransparency="True" Focusable="False" PopupAnimation="Slide"&gt;
                              &lt;Grid Name="DropDown" SnapsToDevicePixels="True" MinWidth="{TemplateBinding ActualWidth}"
                                  MaxHeight="{TemplateBinding MaxDropDownHeight}"&gt;
                                  &lt;Border x:Name="DropDownBorder" Background="White" BorderThickness="1"/&gt;
                                  &lt;ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True"&gt;
                                      &lt;StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" /&gt;
                                  &lt;/ScrollViewer&gt;
                              &lt;/Grid&gt;
                          &lt;/Popup&gt;
                      &lt;/Grid&gt;
                  &lt;/ControlTemplate&gt;
              &lt;/Setter.Value&gt;
          &lt;/Setter&gt;
  
          &lt;Style.Triggers&gt;
          &lt;/Style.Triggers&gt;
      &lt;/Style&gt;
  
  &lt;/UserControl.Resources&gt;
  </code></pre>
  
  <p>USAGE :</p>
  
  <pre><code>   &lt;ComboBox ItemsSource="{Binding MtrCm}" SelectedValue="{Binding WellboreDiameter_Unit, Mode=TwoWay}" Grid.Row="1" Height="23" HorizontalAlignment="Right" Margin="0,26,249,0" x:Name="cboWellDiameter" VerticalAlignment="Top" Width="120" /&gt;
  </code></pre>
  
  <p>Can anyone help me know or what setting is wrong/to be added to make it workable as required and see the selected item text in the combo box. Thanks a lot.</p>