开发者

How to set the ValueConversion attribut for a IMultiValueConverter

开发者 https://www.devze.com 2023-01-29 04:09 出处:网络
I changed my converter from IValueConverter to IMultiValueConverter : Previously I converted int to string :

I changed my converter from IValueConverter to IMultiValueConverter : Previously I converted int to string :

[ValueConversion(typeof(int), typeof(string))]

But now I convert an int and a double to a string.

How should I specify my ValueConversion attribut now ? I have two input and on开发者_Python百科e output now.


I dont think you can use ValueConversionAttribute with an implementation of IMultiValueConverter

I think ValueConversionAttribute is primarily used for design-time support and MultiBindings dont seem to make much sense in this context


I've never seen ValueConversionAttribute applied to IMultiValueConverter implementing class. And there is no appropriate attribute for this kind of converter in System.Windows.Data namespace. You can safely omit the attribute at all.

0

精彩评论

暂无评论...
验证码 换一张
取 消