WPF: Display a bool value as “Yes” / “No”

后端 未结 7 1920
盖世英雄少女心
盖世英雄少女心 2020-11-30 00:21

I have a bool value that I need to display as \"Yes\" or \"No\" in a TextBlock. I am trying to do this with a StringFormat, but my StringFormat is ignored and the TextBlock

7条回答
  •  遥遥无期
    2020-11-30 01:14

    There is also another really great option. Check this one : Alex141 CalcBinding.

    In my DataGrid, I only have :

    
    

    To use it, you only have to add the CalcBinding via GitHub, than in the UserControl/Windows declaration, you add

    
    

提交回复
热议问题