I have a ComboBox with country codes and phone numbers (+43.., ..) The ItemsSource is a list of Country objects with many properties (Code is one of them.) The DataContext in which the ComboBox is located is an object with the PhoneNumber property.
When user selects a country in the list, I want to update the source PhoneNumber Property(which is a string) with the '+43' value from the Country object. The list appears, but the source is never updated. How to do that? When I replace it with this TextBox, everything works fine:
<TextBox Text="{Binding Path=CountryCode, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" />
<ComboBox ItemsSource="{x:Static Member=data:Country.AllCountries}" SelectedValuePath="Country.Value.Code" SelectedValue="??" >