I was working with the ComboBox control and couldn't get the SelectedItem to be set from the property on my viewmodel. Here is the control definition:
<ComboBox x:Name="jobEmployee" Grid.Column="1" Grid.Row="2"
Margin="4" HorizontalAlignment="Left" Width="150"
SelectedItem="{Binding Path=EditingJob.Employee, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}"
ItemsSource="{Binding Path=Employees, Mode=OneWay}"
DisplayMemberPath="FullName"/>
I had another Combobox control that worked jut fine. The difference between one that would set the SelectedItem and the one that wouldn't was the order of the attribute definition. Here is the working control definition:
<ComboBox x:Name="jobEmployee" Grid.Column="1" Grid.Row="2"
Margin="4" HorizontalAlignment="Left" Width="150"
ItemsSource="{Binding Path=Employees, Mode=OneWay}"
SelectedItem="{Binding Path=EditingJob.Employee, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}"
DisplayMemberPath="FullName"/>
The difference between the 2 is that the ItemsSource is defined before the SelectedItem on the working one which leads me to believe that in this case at least, the attribute definition order matters. Am I missing something or have others found this to be true? Has it been documented anywhere?