Conditional formating of a TextBlock within a Listbox’s DataTemplate

前端 未结 2 623
庸人自扰
庸人自扰 2021-01-23 11:14

It’s my first wcf & I’m running into some trouble with what seems to be a basic XAML concept.

Somehow the DataTrigger / Binding in the “PriorityStyle” is not working

2条回答
  •  悲&欢浪女
    2021-01-23 11:39

    as @HighCore mentioned not sure where your setting the Source for your ListBox, but provided your binding works in the Style for ListBoxItem you can try a work-around

    
    

    but your also binding Priority property to Text in the TextBlock with PriorityStyle anyways. So you could also just do:

    
    

    this way you don't even need a binding traversing through your element tree

提交回复
热议问题