Hi, I have searched around and it seems very easy to bind enums to combobox, just retrieve Enum values as a list of strings via an ObjectDataProvider from the static Enum.GetValues method, however i can't get it to work. The error is Type ContactExportType was not found.
I have an enum called ContactExportType, it resides on Enums class. This class is part of the CEM.Marketing.Objects namespace.
This is what i have:
<UserControl
xmlns:local="clr-namespace:CEM.Marketing.Objects"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
<Grid>
<Grid.Resources>
<ObjectDataProvider MethodName="GetValues"
ObjectType="{x:Type sys:Enum}"
x:Key="ContactExportTypes">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="local:ContactExportType" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</Grid.Resources>
</Grid>
<ComboBox
ItemsSource="{Binding {StaticResource ContactExportTypes}}"
...
Thanks, Angela