On my ViewModel, I have 2 properties (both implement property changed notifications) :
CountryOfIssue
Nationality
On my View, I have a CollectionViewSource pointing to a local instance of my Entity Framework context :
<CollectionViewSource x:Key="cvsCountries" Source="{Binding LocalContext.Countries}" CollectionViewType="{x:Type ListCollectionView}">
<CollectionViewSource.SortDescriptions>
<scm:SortDescription PropertyName="Name" />
</CollectionViewSource.SortDescriptions>
</CollectionViewSource>
Also on this page, I have two comboboxes used to set the values of CountryOfIssue and Nationality :
<ComboBox IsEnabled="{Binding CanEditCountryOfIssue}" ItemsSource="{Binding Source={StaticResource cvsCountries}}" DisplayMemberPath="Name" SelectedValuePath="Id" SelectedItem="{Binding CountryOfIssue, Mode=TwoWay, UpdateSourceTrigger=LostFocus, ValidatesOnDataErrors=True}" />
<ComboBox IsEnabled="{Binding CanEditNationality}" ItemsSource="{Binding Source={StaticResource cvsCountries}}" DisplayMemberPath="Name" SelectedValuePath="Id" SelectedItem="{Binding Nationality, Mode=TwoWay, UpdateSourceTrigger=LostFocus, ValidatesOnDataErrors=True}" />
With this setup, whenever I change one of the comboboxes' value, the other one changes as well... Is this expected behavior?
(I've implemented a fix by using another CollectionViewSource, I just want to know if this is normal)
ComboBox
elements in aDataGrid
column's cells, and a new instance ofCollectionViewSource
was causing them to all set to the same value when changed. – Corny