I’m working myself through a Tutorial for MEF (Managed Extensibility Framework) for C#, but can’t get the exaple-project wo work, because of those two code-lines (in the linked tutorial they can be found beneath the big picture of the interface):
cbTransformationOptions.ItemsSource = _tranformationEngine.Transformers;
cbTransformationOptions.DisplayMemberPath = "Name";
the mentioned cbTransformationOptions is a ordinary ComboBox. The code won’t compile, i’m getting the following errors:
'System.Windows.Forms.ComboBox' does not contain a definition for 'ItemsSource'
and no extension method 'ItemsSource' accepting a first argument of type
'System.Windows.Forms.ComboBox' could be found (are you missing a using directive
or an assembly reference?)
'System.Windows.Forms.ComboBox' does not contain a definition for 'DisplayMemberPath'
and no extension method 'DisplayMemberPath' accepting a first argument of type
'System.Windows.Forms.ComboBox' could be found (are you missing a using directive
or an assembly reference?)
What i figured out untill now, is, that both of those statements are somehow linked to WPF / XAML (i found some references on StackOverflow)- but i don’t have any experience on that topic, so those answers didn’t help me at all.
How do I get the code to work?
System.Windows.Forms is the wrong namespace you need to create a wpf project.