Silverlight: How to use a binding in setter for a style (or an equivalent work around)

前端 未结 4 899
臣服心动
臣服心动 2020-12-17 15:26

If the person who answered this question is right, you cannot put a binding as the value in a setter in a style in Silverlight. Which is a shame, because I have 4 textblocks

4条回答
  •  伪装坚强ぢ
    2020-12-17 16:17

    Here is how its done. You use a ContentControl and specify a ControlTemplate for it as a static resource:-

    
        
            
        
    
    
    
    

    Now you can bung as may other properties with bindings in to the Control Template as you want.

    This approach could be extended to Style:-

    
        
            
        
        
    
    
    
    

提交回复
热议问题