WPF Trigger not null

前端 未结 3 562
深忆病人
深忆病人 2021-02-06 14:49

How to trigger an action in WPF when the Property is not null? This is a working solution when is null:

         


        
3条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-06 15:28

    You can use DataTrigger class in Microsoft.Expression.Interactions.dll that come with Expression Blend.

    Code Sample:

    
        
           
        
    
    

    Using this method you can trigger against GreaterThan and LessThan too. In order to use this code you should reference two dll's:

    System.Windows.Interactivity.dll
    Microsoft.Expression.Interactions.dll

    And add the corresponding namespaces:

    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"  
    xmlns:ie="http://schemas.microsoft.com/expression/2010/interactions"
    

提交回复
热议问题