In a WPF app I want to move a UserControl from a ContentControl to another one in code:

```
 myContentControl2.Content = myUserControl;

```

in this case I get an error:  

*Specified element is already the logical child of another element. Disconnect it first.*

In a [ControlControl class description](http://msdn.microsoft.com/en-us/library/system.windows.controls.contentcontrol.aspx) I can see a [RemoveVisualChild method](http://msdn.microsoft.com/en-us/library/system.windows.media.visual.removevisualchild.aspx), but when I try to use it in code I get an **Unknown method** error

```
myContentControl1.RemoveVisualChild(myUserControl);//here I get an "Unknown method" error

```

Where am I wrong?  

**How to move a UserControl from a ContentControl to another one in code-behind?**