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

后端 未结 7 2112
北海茫月
北海茫月 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:24

    So looks like you are trying to give the proper DataContext to the HyperLink so as to trigger ICommand. I think a simple element name binding can solve this.

    
     
      
       
        
           
               
           
        
      
    
    

    The AncestorType checks only for Visual-Types not for ViewModel types.

提交回复
热议问题