What is best practise for IValueConverter?

前端 未结 3 781
萌比男神i
萌比男神i 2021-01-02 17:14
  • What is best practise for IValueConverter?
  • Is it ok to put Exception in Convert method or should it return \"something\"?
3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-02 18:05

    I personally recommend using singleton converters. Then you don't have to create an instance at every usage site, but can reference the converter like this:

    Converter={x:Static SomeNamespace:SomeConverter.Instance}
    

提交回复
热议问题