Loading

WPF ComboBox 默认选中无效

WPF开发当中,我发现ComboBox默认选中逻辑失效了,仔细查找后发现后台逻辑并没有出现问题

测试后发现在XAML中,ComBoBox控件的SelectedValue属性需要写在ItemSource之前,默认选中又恢复正常了。

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

搬运转发请链接注明出处。

posted @ 2019-12-24 18:32  Stay627  阅读(1012)  评论(1编辑  收藏  举报