I have a Combo Box that has ItemsSource Bound to an Enumeration using ObjectDataProvider, and its SelectedItem Property is bound to a property of a businessobject. For some reason it's binding SelectedItem first and ItemsSource second, therefore overwriting my default on the businessobject property. Any ideas why and possibly a fix? Thanks in Advance.
XAML:
<CollectionViewSource x:Key="Units">
<CollectionViewSource.Source>
<ObjectDataProvider MethodName="GetNames" ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="BO:Unit"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</CollectionViewSource.Source>
</CollectionViewSource>
<ComboBox Grid.Column="1" HorizontalAlignment="Right" Width="80"
ItemsSource="{Binding Source={StaticResource Units}}"
SelectedItem="{Binding Path=Unit}"/>