Binding WindowsFormsHost Child property
<p>I am creating an MVVM application. </p>

<p>In my <strong>model</strong> I need <strong>handle</strong> to a <em>System.Windows.Forms.Panel</em> that is being displayed in the <strong>View</strong>. My idea is to <strong>create</strong> this Panel in the <strong>ViewModel</strong> and then from one side - <strong>bind the View to it</strong>, on the other side, pass its <strong>handle to the model</strong>.</p>

<p>I've got an WindowsFormsHost control:</p>

<pre><code>&lt;Page x:Class="Test.Views.RenderPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:WinForms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:local="clr-namespace:Test.Views"
      mc:Ignorable="d" 
      d:DesignHeight="800" d:DesignWidth="1200"
      Title="Page1"&gt;

    &lt;DockPanel&gt;
        &lt;WindowsFormsHost x:Name="winformsHost" Child="{Binding RenderPanel}"/&gt;
    &lt;/DockPanel&gt;
&lt;/Page&gt;
</code></pre>

<p>And I would like to bind it's Child property with my RenderPanel provided by ViewModel</p>

<pre><code>public ObservableObject&lt;System.Windows.Forms.Panel&gt; RenderPanel { get; private set; }

public VideoRecorderViewModel ()
{
    RenderPanel = new System.Windows.Forms.Panel (); //Bind it here
    var model = new Model (RenderPanel.Handle); pass it to the model
}
</code></pre>

<p>However, I am getting an error saying that:</p>

<pre><code>System.Windows.Markup.XamlParseException: 
A 'Binding' cannot be set on the 'Child' property of type 'WindowsFormsHost'. 
A 'Binding' can only be set on a DependencyProperty of a DependencyObject.
</code></pre>

<p>How to fix this?</p>