1

I'm trying to follow the solution from this post in my WF4 project: Databinding an enum property to a ComboBox in WPF

And I've implemented the code

<ObjectDataProvider MethodName="GetValues"
    ObjectType="{x:Type s:Enum}"
    x:Key="DayOfWeekValues">
    <ObjectDataProvider.MethodParameters>
        <x:Type TypeName="s:DayOfWeek" />
    </ObjectDataProvider.MethodParameters>
</ObjectDataProvider>

<ComboBox ItemsSource="{Binding Source={StaticResource DayOfWeekValues}}"/>

I'm getting the following error on the TypeName="s:DayOfWeek" property.

Cannot reparent the node "Type(System.DayOfWeek)" from the old parent "IList" to the new parent "ObjectDataProvider".

Any ideas about what this error means?

EDIT: In addition to the error above, I'm also getting the following error on the MethodName="GetValues" property on the ObjectDataProvider.

INCORRECT_PARAMETER_TYPE
Community
  • 1
  • 1
Nael
  • 1,479
  • 1
  • 14
  • 20
  • To followup, even though I was getting the error, I tried to use the activity anyway. There was no problem using the activity in my main workflow. It found the enum values just fine. – Nael Sep 29 '10 at 18:36
  • I was impatient about getting that "reparenting" error as well but it compiles nonetheless. Thanks for the tip ! – Dr1Ku Nov 29 '10 at 15:04

1 Answers1

5

Just rebuild (not build) the solution or rebuild the project and it will work just fine.

Louis Rhys
  • 34,517
  • 56
  • 153
  • 221