Which namespace/DLL to use for ValueConversion in

2019-09-18 20:47发布

I am converting a SL3 application to SL4 and facing some issues.

Can anyone provide me the namespace or DLL name for ValueConversion.

I am getting error on the following statement.

[ValueConversion(typeof(ToolType), typeof(bool))]

Thanks for sharing your time.

2条回答
疯言疯语
2楼-- · 2019-09-18 21:06

This class is not part of Silverlight Runtime Classes now. it was there in System.Windows.Data namespace before. Ref: http://msdn.microsoft.com/en-us/library/system.windows.data.valueconversionattribute.aspx

you can use IValueConverter interface as before.

查看更多
来,给爷笑一个
3楼-- · 2019-09-18 21:07

I use the following implementation in ClipFlair Studio: http://ClipFlair.codeplex.com (see Client/Helpers/WPF_Compatibility/WPF_Compatibility.Silverlight project at the sourcecode)

查看更多
登录 后发表回答