问题
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