Я сам прорабатываю учебник для MEF ( Managed Extensibility Framework ) для C #, но не могу получить работу exaple-проекта из-за этих двух кодов-линии (в связанном уроке их можно найти под общей картинкой интерфейса):
cbTransformationOptions.ItemsSource = _tranformationEngine.Transformers;
cbTransformationOptions.DisplayMemberPath = "Name";
упомянутый cbTransformationOptions
- обычный ComboBox.Код не скомпилируется, я получаю следующие ошибки:
'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?)
До сих пор я понял, что оба эти утверждения так или иначе связаны с WPF / XAML (я нашел несколько ссылокв StackOverflow) - но у меня нет опыта в этой теме, поэтому эти ответы мне совсем не помогли.
Как заставить работать код?