How to change the WPF XAML to reflect changes in the C# code-behind?

后端 未结 1 1520
暗喜
暗喜 2021-01-28 17:41

I am refractoring the code from sample:

  • 24.129.21. Master Detail Binding
    from C# / CSharp Tutorial » Windows Presentation Foundation » Binding)
1条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-28 18:23

    In your Window1.xaml class remove the reference to the skills class: (e.g. ) since you don't have a Skills class anymore. Instead you want a number of Skill elements inside your ObservableCollection:

    
       
         
            
            
           ....
    

    Also, you should probably initialize the Skills ObservableCollection inside the Employee's constructor.

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