I learnt about converters and itemtemplates in WPF

I had an issue with binding a combobox to a bunch of type names. I had a converter which strips out the rubbish and just leaves the type name on it’s own however I was doing this on the ItemsSource which meant that when the item was selected it returned just the display name.

After a little investigation I found the following solution:

<ComboBox x:Name="Collector" Grid.Column="1" SelectedItem="{Binding Collector}" 
ItemsSource="{Binding Source={StaticResource CollectorsAvailable}}"
SelectedValuePath="." VerticalAlignment="Center"
SelectionChanged="Collector_OnSelectionChanged">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=.,Converter={x:Static Core:TypeNameConverter.Instance}}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>


There may still be some changes that I need to optimize this but this seems to work.