Click here to Skip to main content
15,922,315 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

I face problem using IValueConverter in WPF project.
I have installed Async CTP frame work (V:3.0) with following detail

VS: 2010 SP1
Async CTP framework 3.0
.net farmework 4.0


Application is working well with async/await. Only issue i face when I use converter. I don't know what this issue is

I have imported AsyncCtpLibrary.dll and System.Threading.Tasks.Dataflow.dll.

Error that I face when i add reference of converter in xaml

Cannot find all types required by the 'async' modifier. Are you targeting the wrong framework version, or missing a reference to an assembly?

Predefined type 'System.Runtime.CompilerServices.IAsyncStateMachine' is not defined or imported


Is there any requirement for using converter

One thing again I am not going to upgrade to 4.5. and issue only found when use of any converter
Bellow is simple code for converter.

C#
public class TriggerTypeConverter : IValueConverter
   {
       public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
       {
           if (value != null)
           {
               if (value.ToString().ToUpper().Equals("ADMN"))
               {
                   return "Admin Sync Trigger(s)";
               }
               else if (value.ToString().ToUpper().Equals("CMS"))
               {
                   return "CMS Trigger(s)";
               }
           }
           return null;
       }


and XAML where i reference converter (referenced namespace address is ok. so no issue with directive)

HTML
< xmlns:converter="clr-namespace:NFS.Admin.Converters" >

    <my1:UserControl.Resources>
        <converter:TriggerTypeConverter x:Key="triggerTypeConverter"/>
        <converter:EnableTypeConverter x:Key="enableTypeConverter"/>
    </my1:UserControl.Resources>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900