Display a default DataTemplate in a ContentControl when its content is null or empty?

后端 未结 3 850
逝去的感伤
逝去的感伤 2020-12-13 03:48

I would think this is possible, but the obvious way isn\'t working.

Currently, I\'m doing this:



        
3条回答
  •  天涯浪人
    2020-12-13 04:32

    Simple, you have to bind the content property in the style. Styles won't overwrite a value on a control if there's a binding present, even if the value evaluates to Null. Try this.

    
        
            
        
    
    

提交回复
热议问题