WPF Styles Button MouseOver Question

前端 未结 2 1847
不知归路
不知归路 2020-12-30 11:45

I am trying to make a simple mouseover effect on a button, It does change the color when mouse is over but the color is immediately changed to the default button background.

2条回答
  •  执笔经年
    2020-12-30 12:16

    Overriding the ButtonChrome theme would be easier.

    Create a template and remove the RenderMouseOver="{TemplateBinding IsMouseOver}"

    
        
            
                
                    
                
                
                    
                        
                    
                    
                        
                    
                    
                        
                    
                
            
        
    
    

    And then add your own handling of mouseover

        
            
                
                    
                        
                            
                            
                        
                    
                
            
        
    

    That should solve it! :)

提交回复
热议问题