Style with a DataTrigger that has different Bindings

后端 未结 2 1864
天命终不由人
天命终不由人 2021-01-21 02:38

I have a series of TextBlocks to which I want apply a Style and DataTrigger. The only difference is that the Binding is to a different property in the view model for each one.<

2条回答
  •  孤独总比滥情好
    2021-01-21 02:59

    Declare the style at the top of the page like this

    
      
    
    

    Then the TextBlock should be like this

    
    

提交回复
热议问题