DelegateCommand is not invoked in context menu

前端 未结 3 902
感动是毒
感动是毒 2021-01-25 11:13

I can`t seem to get this right click popup menu to work.



        
3条回答
  •  梦谈多话
    2021-01-25 11:48

    ContextMenu ist not part the the Visual Tree and so FindAncestory data binding won't work.

    You could set the DataContexton the ContextMenuexplicitly though.

    e.g. you could create an instance of your ViewModel / DataContext directly in XAML if that's an option.

    
    

    Or get it from a StaticResource.

      
        
    
        
      
    

提交回复
热议问题