Context Menu items command binding WPF using MVVM

后端 未结 5 547
眼角桃花
眼角桃花 2021-01-01 04:56

I know this question has been asked many times in different ways in many websites and also in StackOverFlow but all the answers I found are not helping me ot to be precise I

5条回答
  •  时光取名叫无心
    2021-01-01 05:42

    Something in your code (or the version of WPF being used at the time(?)) is overcomplicating things. I am able to bind such as

    
        
            
                
                
            
        
    
    

    Where the command is setup like this:

    VM.DeleteItem 
         = new OperationCommand((o) => MessageBox.Show("Delete Me"),
                                (o) => (myGrid.SelectedItem as Order)?.InProgress == false );
    

提交回复
热议问题