<Window x:Class="ComboBoxWithDataBinding.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:ComboBoxWithDataBinding"
        Title="ComboBox" Height="300" Width="300">
    <StackPanel Margin="10" >
        <StackPanel.Resources>
            <local:Countries x:Key="countries"/>
            <DataTemplate x:Key="countryTemplate" >
                <StackPanel Orientation="Horizontal"  >
                    <Image Source="{Binding Path=Flag}"/>
                    <TextBlock Text="{Binding Path=Name}" Margin="4" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="30" FontWeight="Bold"/>
                </StackPanel>
            </DataTemplate>
        </StackPanel.Resources>
        <ComboBox IsEditable="True" IsReadOnly="False" TextSearch.TextPath="Name" 
             ItemsSource="{Binding Source={StaticResource countries}}"
             ItemTemplate="{StaticResource countryTemplate}"/>
    </StackPanel>
</Window>
