binding a command inside a listbox item to a property on the viewmodel parent

后端 未结 7 2108
北海茫月
北海茫月 2020-12-15 18:42

I\'ve been working on this for about an hour and looked at all related SO questions.

My problem is very simple:

I have HomePageVieModel:

Home         


        
7条回答
  •  遥遥无期
    2020-12-15 19:26

    Slightly different example but, I found that by referencing the parent container (using ElementName) in the binding you can get to it's DataContext and its subsequent properties using the Path syntax. As shown below:

    
     
      
       
        
        ...
       
      
     
    
    

提交回复
热议问题