DataTrigger where value is NOT null?

后端 未结 12 658
野趣味
野趣味 2020-11-27 10:56

I know that I can make a setter that checks to see if a value is NULL and do something. Example:


  
    

        
12条回答
  •  猫巷女王i
    2020-11-27 11:11

    You can use a converter or create new property in your ViewModel like that:

    public bool CanDoIt
    {
        get
        {
            return !string.IsNullOrEmpty(SomeField);
        }
    }
    

    and use it:

    
    

提交回复
热议问题