title: Binding a ContentControl to UserControl, and reuse same instance
body: <p>I'm trying to bind a ContentControl's Content to a UserControl I have instantiated in my ViewModel. I cannot use the method with binding to a ViewModel and then have the UserControl be the DataTemplate of the ViewModel, as I need the Content of the ContentControl to be able to change frequently, using the <em>same instance</em> of the UserControls/Views, and not instantiate the views each time i re-bind.</p>
  
  <p>However, when setting the UserControl-property to a UserControl-instance, and then when the view is rendered/data-bound I get: <em>Must disconnect specified child from current parent Visual before attaching to new parent Visual.</em> Even though I have not previously added this UserControl to anywhere, I just created this instance earlier and kept it in memory.</p>
  
  <p>Are there a better way to achieve what I am doing?</p>
  
  <p>In the ViewModel</p>
  
  <pre><code>public class MyViewModel : INotifyPropertyChanged
  {
      //...
  
      private void LoadApps()
      {
          var instances = new List&lt;UserControl&gt;
                            {
                                new Instance1View(),
                                new Instance2View(),
                                new Instance3View(),
                            };
          SwitchInstances(instances);
      }
  
      private void SwitchInstances(List&lt;UserControl&gt; instances)
      {
          CenterApp = instances[0];
      }
  
      //...
  
      private UserControl _centerApp;
      public UserControl CenterApp
      {
          get { return _centerApp; }
  
          set
          {
              if (_centerApp == value)
              {
                  return;
              }
  
              _centerApp = value;
              OnPropertyChanged("CenterApp");
          }
      }
  
      //...
  }
  </code></pre>
  
  <p>In the View.xaml</p>
  
  <pre><code>&lt;ContentControl Content="{Binding CenterApp}"&gt;&lt;/ContentControl&gt;
  </code></pre>