How do you handle data grid cell changes with MVVM?

前端 未结 2 2009
[愿得一人]
[愿得一人] 2021-01-13 01:45

I\'m trying to figure out how to handle changes in a data grid cell while keeping within the MVVM design pattern. When the user changes the value in a cell, I have to go off

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-13 02:10

    Usually i do this with interaction triggers from Galasoft.

     
                
                    
                        
                    
                
            
                   ...                        
        
    
    

    Then inside ViewModel you create generic RelayCommand where generic type is type of corresponding EventArgs.

    RelayCommand CellEditEndingCommand {get; set;}
    

    Initialization:

    CellEditEndingCommand = new RelayCommand(args=>DoSomething());
    

提交回复
热议问题