title: How to display combo box as textbox in WPF via a style template trigger?
body: <p>I would like to display a combobox drop down list as a textbox when it's set to be read only. For some reason I can't seem to bind the text of the selected item in the combo box to the textbox. This is my XAML:</p>
  
  <pre><code> &lt;Style x:Key="EditableDropDown" TargetType="ComboBox"&gt;
          &lt;Style.Triggers&gt;
              &lt;Trigger Property="IsReadOnly" Value="True"&gt;
                  &lt;Setter Property="Background" Value="#FFFFFF" /&gt;
                  &lt;Setter Property="Template"&gt;
                          &lt;Setter.Value&gt;
                          &lt;ControlTemplate TargetType="ComboBox"&gt;
                              &lt;TextBox Text="{TemplateBinding SelectedItem, Converter={StaticResource StringCaseConverter}}" 
                                         BorderThickness="0"
                                         Background="Transparent"
                                         FontSize="{TemplateBinding FontSize}" 
                                         HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                                         FontFamily="{TemplateBinding FontFamily}"
                                         Width="{TemplateBinding Width}" 
                                         TextWrapping="Wrap"/&gt;
                          &lt;/ControlTemplate&gt;
                      &lt;/Setter.Value&gt;
                  &lt;/Setter&gt;
              &lt;/Trigger&gt;
          &lt;/Style.Triggers&gt;
      &lt;/Style&gt;
  
  &lt;ComboBox IsReadOnly="{Binding ReadOnlyMode}" Style="{StaticResource EditableDropDown}" Margin="0 0 10 0"&gt;
         &lt;ComboBoxItem IsSelected="True"&gt;Test&lt;/ComboBoxItem&gt;
  &lt;/ComboBox&gt;
  </code></pre>
  
  <p>When I do this, I get the following as the text:</p>
  
  <p>System.Windows.Controls.ComboBoxItem: Test</p>
  
  <p>I would really appreciate the help!</p>