WPF ComboBox selected by default invalid

In WPF in development, I found ComboBox 's selected by default logic fails, after a close look and discover the logic behind no problems .

After the test found in XAML in, the ComboBox control's SelectedValue property need to write in ItemSource before, selected by default has returned to normal a.

<ComboBox SelectedValue="{Binding TypeValue}" ItemsSource="{Binding CmbListItem}" SelectedItem="{Binding CmbSelectItem}" SelectedValuePath="TypeValue" DisplayMemberPath="Member"/>

Guess you like

Origin www.cnblogs.com/Stay627/p/12092985.html