Binding to ViewModel.SubClass.Property (sub-property)

前端 未结 2 657
青春惊慌失措
青春惊慌失措 2020-12-19 05:32

let\'s say i have a section on my screen where \"current record\" is edited.. so my view model has a class with all currently edited properties such as:

cla         


        
2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-19 05:59

    The above should work, {Binding Path=CurrentRecord.Notes} is right. Can you check that your datacontext is set to your viewmodel?

    Also check if your viewmodel implements INotifyPropertyChanged.

    edit: I just created a sample project to recreate this. No need to implement INotifyPropertyChanged, it just works when the datacontext is set to the VM.

提交回复
热议问题