WPF XAML - DataTriggers or ValueConverters? Best practice

前端 未结 2 740
不思量自难忘°
不思量自难忘° 2021-01-23 07:14

I have a Window with a TextBlock. This TextBlock has to show the value \"R\" if the binded value is 0 or \"M\" if the binded value is 1.

I have

2条回答
  •  礼貌的吻别
    2021-01-23 07:20

    Converters are Best in this scenario. As the name indicates converter converts the type. In this case you want to convert int to Char, so converters are much suitable. For More Info : ConverterPerformance

提交回复
热议问题