Conditional formating of a TextBlock within a Listbox’s DataTemplate

前端 未结 2 651
庸人自扰
庸人自扰 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 12:00

    I found out the real issue to my problem. It was not in fact a binding issues but a Style issue.

    I didn’t include it in the original XAML as I did some wrongful cleaning in order to make it clearer. I was including in my Textblock a “Foreground” attribute an this last one was indeed overriding my style attribute. Removing it and including the “Default Foreground” Value in the Style Setter was the answer. Beginners mistake.

    So, kudos to Viv, for pointing out the right direction & for the nice “RelativeSource” example. And sorry again for my bad question, a lesson learned here.

        
    
        
    

提交回复
热议问题