Note that there are some explanatory texts on larger screens.

plurals
  1. POText Will not show for selected Item in ComboBox
    primarykey
    data
    text
    <p>I feel really stupid for asking this but I have been thrashing for over 8 hours. How do I get the Selected Item to show its text in my WPF combo box when selected? </p> <p><img src="https://i86.photobucket.com/albums/k83/Aaronls79/DisplayerOptions.jpg" alt="Diplay Options"></p> <p>Above is an option dialog that allows users to select and configure the available tournament displays. The problem is the selected combo box item shows the UserControl instead of the Display name. </p> <p><strong>On Window Loaded</strong>: </p> <pre><code> //_displayer is a private member populated using MEF //[ImportMany(typeof (IDisplayer))] //private IEnumerable&lt;IDisplayer&gt; _displayers; DisplayTypeComboBox.ItemsSource = _displayers; </code></pre> <p><strong>The ComboBox Xaml:</strong> </p> <pre><code> &lt;ComboBox Name="DisplayTypeComboBox" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="1" IsEditable="False" SelectionChanged="DisplayTypeComboBox_SelectionChanged"&gt; &lt;ComboBox.ItemTemplate&gt; &lt;DataTemplate&gt; &lt;ComboBoxItem Content="{Binding DisplayerName}" /&gt; &lt;/DataTemplate&gt; &lt;/ComboBox.ItemTemplate&gt; &lt;/ComboBox&gt; </code></pre> <p><strong>The IDisplayer:</strong> </p> <pre><code>public interface IDisplayer { string DisplayDataLocation { get; set; } string DisplayerName { get; } string DisplayerDescription { get;} bool WatcherEnabled { get; } UserControl View { get; } string DisplayerImageLeft { get; set; } string DisplayerImageRight { get; set; } void Update(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload