我试图在我的WF4项目中遵循这篇文章中的解决方案:将枚举属性数据绑定到WPF中的ComboBox
我已经实现了代码
<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}}"/>
Run Code Online (Sandbox Code Playgroud)
我在TypeName ="s:DayOfWeek"属性上收到以下错误.
Cannot reparent the node "Type(System.DayOfWeek)" from the old parent "IList" to the new parent "ObjectDataProvider".
Run Code Online (Sandbox Code Playgroud)
有关此错误含义的任何想法?
编辑:除了上面的错误,我还在ObjectDataProvider上的MethodName ="GetValues"属性上收到以下错误.
INCORRECT_PARAMETER_TYPE
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1549 次 |
| 最近记录: |