WindowsFormsHost Child Binding

May 19, 2010 at 9:09 PM

My view has a windows forms host.

I need to bind the child property to a custom control.

Obviously in the .xaml code behind I can reference something like this

this.windowsFormsHost1.Child = myCustomControl



But I dont want to do this, ideally the Child property in the view would bind to my custom control in the view model

When I do this I get error

"A 'Binding' cannot be set on the 'Child' property of type 'WindowsFormsHost'. A 'Binding' can only be set on a DependencyProperty of a DependencyObject."

Any help would be GREATLY APPRECIATED.

Thanks!

 

Aug 23, 2011 at 12:49 PM
Edited Aug 23, 2011 at 12:50 PM

I'm trying to do exactly the same thing and get the same error message.  Did you find a solution?

Thanks for any help you can give! :-)

 

Aug 24, 2011 at 1:52 PM

 

 

It's ok I figured it out.     I used binding on a ContentControl to load the Conent property, the content being an instance of WindowsFormHost and it's child. 

Hope it helps.