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

前端 未结 2 655
青春惊慌失措
青春惊慌失措 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:57

    Make sure that your CurrentRecord property is 1) being set and 2) notifying the UI layer that a change has occurred.

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题