WPF: How to set bool to true from DataTemplate for Button?

前端 未结 2 1392
刺人心
刺人心 2021-01-28 15:52

I know it is possible to do this by working with ICommand, but since this is the only place in my whole project where this is needed, I am asking myself, if there is maybe a bet

2条回答
  •  Happy的楠姐
    2021-01-28 16:33

    why not use ToggleButton and bind IsChecked property to IsToDelete property of a viewModel?

    simplified example with ItemsControl

    
        
            
                
                    
                    
    
                        
                            
                        
    
                    
                
            
                    
    
    

提交回复
热议问题