Binding DependencyProperty to non-DependencyProperty

烈酒焚心 提交于 2019-12-11 20:05:25

问题


I have a usercontrol from winforms. In the XAML I am trying to bind a dependency property to one of the usercontrol's property as below (which is not a dependency property)

<Pricing:UserControl1  UserControlProperty="{Binding CurrentProductItem.ComponentId}"  />

I am getting an error A 'Binding' cannot be set on the 'UserControlProperty' property of type 'UserControl1'. A 'Binding' can only be set on a DependencyProperty of a DependencyObject. How I can solve this issue? Do I need to make UserControlProperty as dependencyproperty?

来源:https://stackoverflow.com/questions/26270453/binding-dependencyproperty-to-non-dependencyproperty

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!