title: Copy all the data from one user control to another user control of Same Type
body: <p>I want to transfer all data from HomeAddressUC to PermanentAddressUC with checkBox SameAsPrevious</p>
  
  <p>Each UserControl has same Type(AddressUserControl)</p>
  
  <p><img src="https://i.stack.imgur.com/3jaFw.jpg" alt="enter image description here"></p>
  
  <p>DataSource to Fill HomeAddressUC is code is like this </p>
  
  <pre><code>private void SetTabPageDetails(string tabPageName, CustomerDetails customerDetailsCache)
  {
       customerDetailsCache = // calling stored procedure
       PermanentAddressUC.SetDetails(customerDetailsCache.Addresses[0]);
  }
  </code></pre>
  
  <p>Scope of that DataSource is upto it method <code>SetTabPageDetails()</code> only 
  logic I was trying to implement is on checkbox changed event is </p>
  
  <pre><code>if (chkSameAsPervious.Checked)
  {
      foreach (var addressCtl in from Control ctl in this.ADDRESS_TAB.Controls select ctl as BankSys24.UI.UserControls.AddressUserControl)
      {
          if (addressCtl.GroupBoxText == "Mailing Address")
          {
              // want to do something here
          }
      }
  }
  </code></pre>
  
  <p>I try to follow the relevant link </p>
  
  <p><a href="https://stackoverflow.com/questions/1063010/best-practice-when-you-need-two-user-controls-winforms-to-communicate?rq=1">Best practice when you need two user controls (winforms) to communicate</a></p>
  
  <p>it says to use the Third Common User Control a Container or interface </p>
  
  <p>What is the optimized way to do it?</p>