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?
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.
On Window Loaded:
//_displayer is a private member populated using MEF
//[ImportMany(typeof (IDisplayer))]
//private IEnumerable<IDisplayer> _displayers;
DisplayTypeComboBox.ItemsSource = _displayers;
The ComboBox Xaml:
<ComboBox
Name="DisplayTypeComboBox"
Grid.Column="1"
Grid.ColumnSpan="2"
Grid.Row="1"
IsEditable="False"
SelectionChanged="DisplayTypeComboBox_SelectionChanged">
<ComboBox.ItemTemplate>
<DataTemplate>
<ComboBoxItem Content="{Binding DisplayerName}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
The IDisplayer:
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();
}