I have a table User with a foreign key IDTown to a table of Town. They are in different datacontexts and i'm trying to edit them on usercontrol. i have a combobox that is working when adding a new user, but when i try to update Town i get an error from linq ForeignKeyReferenceAlreadyHasValueException. This is the combobox.
<ComboBox x:Name="PlacesComboBox" SelectedValue="{Binding IDCity, Mode=TwoWay}" SelectedValuePath="ID" DisplayMemberPath="NameOfThePlace" ItemsSource="{Binding DataContext.AllPlaces, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" />