How to bind a combobox with Foreign Key in WPF MVVM

前端 未结 2 784
旧时难觅i
旧时难觅i 2021-01-06 14:02

I know that there are many questions regarding DataBinding a combobox and also there are many tutorials but I feel those tutorials hard. So, I am asking this question.

2条回答
  •  生来不讨喜
    2021-01-06 14:36

    Add Genders in ViewModel class

    public List Genders
            {
                get
                {
                    return _genders;
                }
                set
                {
                    _genders = value;
                    OnPropertyChanged("Genders");
                }
            }
    

    After use like this.

    
                
                    
                        
                            
                            
                            
                            
                        
                    
                
            
    

提交回复
热议问题