问题描述:左侧是一个ListView控件,用于显示User类的Name属性,右侧显示其SelectedItem的其他属性,包括Age, Address,和Category。其中Category用ComboBox表示。在下拉框选中其他category,可以更改User的属性值。

WPF中ComboBox控件的SelectedItem和SelectedValue的MVVM绑定

 

 WPF中ComboBox控件的SelectedItem和SelectedValue的MVVM绑定

 

 WPF中ComboBox控件的SelectedItem和SelectedValue的MVVM绑定

 

 如果Category是string类型,即User类的定义如下

public class User
    {
        public string Name { get; set; }
        public int Age { get; set; }
        public string category { get; set; }
        public string Address { get; set; }
    }
User Class

相关文章:

  • 2022-01-20
  • 2021-08-05
  • 2022-12-23
  • 2022-12-23
  • 2021-07-06
  • 2022-02-12
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-06
相关资源
相似解决方案