How to inject a Converter in XAML

后端 未结 2 909
天涯浪人
天涯浪人 2021-02-04 15:47

I have an IValueConverter implemented class and I need it to be injected using my DI container (Ninject).

The problem is, in XAML, there\'s no immediately obvious way to

2条回答
  •  盖世英雄少女心
    2021-02-04 16:20

    An alternative approach is, to resolve the dependency via MarkupExtension and set it to the converter's property in XAML.

    See the following answer for details:

    https://stackoverflow.com/a/41611854/2115905

提交回复
热议问题