I'm currently using the following code to build a ComboBox control with flag images and canadian province names. However the images are not showing up in the control. I have tested the binding and it generated the location properly, but the image just doesn't come up in the control.
Not sure what is wrong here any help would be appreciated
Code:
<ComboBox x:Name="cb_Provinces" Text="Province"SelectionChanged="ComboBox_SelectionChanged" SelectedValuePath="ProvinceCode" ItemsSource="{Binding Provinces, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}">
<ComboBox.ItemTemplate>
<DataTemplate >
<StackPanel>
<StackPanel x:Name="stk_ComboTemplate" Orientation="Horizontal" HorizontalAlignment="Left">
<Image Width="25" Margin="10" Source="{Binding ProvinceCode, StringFormat=/CanadaTreeSvc.Interface;component/Resources/img/flags/\{0\}.gif}" />
<TextBlock Text="{Binding ProvinceName}"/>
</StackPanel>
<TextBlock FontSize="10" Foreground="Gray" Text="{Binding ProvinceCode, StringFormat=/CanadaTreeSvc.Interface;component/Resources/img/flags/\{0\}.gif}"/>
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
Resulting Output:

StringFormatis only used if the target property is actually astring, The Image Source property is aUriso the binding won't apply the StrngFormat. You will have to use aIValueConverter