Triggers collection members must be of type EventTrigger

前端 未结 4 1315
一生所求
一生所求 2020-12-16 10:24

I\'ve created a UserControl, similar to the following:


    

        

        
4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-16 10:59

    This may be hopelessly outdated, but the following works for me. It might help people running into the problem with: "Triggers collection members must be of type EventTrigger"

    
      
        
    
          
          
            
            
    
          
          
            
              
            
          
    
        
      
    
    

    Encapsulating "what you want to control" inside a Control object allows you to use the Control.Template to use any trigger you want. This way you can use (data)triggers directly in your XAML where you want to without defining a static style or a completely new UserControl.

提交回复
热议问题