WPF Context Menus in Caliburn Micro

前端 未结 2 2058
旧巷少年郎
旧巷少年郎 2020-12-29 08:39

I\'m trying to get a context menu within a ListBox ItemTemplate to call a method on the parent view model, passing in the item that was clicked on as a parameter. I have thi

2条回答
  •  清酒与你
    2020-12-29 09:09

    Adding to Jason's answer, if you're going to be using the same data context as the control, then you can just bind the DataContext instead of a Tag

    
        
            
                
                
            
        
    
    

    $source The actual FrameworkElement that triggered the ActionMessage to be

    You can see more info about the $source convention in here: https://caliburnmicro.com/documentation/cheat-sheet

提交回复
热议问题