MVVM datagrid binding

前端 未结 5 1586
深忆病人
深忆病人 2020-12-10 16:33

I\'m using MVVM for my project and I\'m trying to bind a table from my database with a DataGrid. But when I run my application datagrid is empty.

MainWindow.

5条回答
  •  既然无缘
    2020-12-10 17:11

    Here we go

     
    

    Then

    private ObservableCollection lecturers;
    
    public ObservableCollection Lecturers
    {
        get { return lecturers; }
        set
        {
            lecturers = value;
            this.NotifyPropertyChanged("Lecturers");
        }
    }
    

提交回复
热议问题