title: UserControl switch
body: <p>There are two different UserControls which share some common Properties.
  What I'd like to do is to switch between these two based on an external flag.</p>
  
  <pre><code>UserControl u1, u2;
  
  if(flag)
  {
      u1 = u1 as ControlType1;
      u2 = u2 as ControlType1;
  }
  else
  {
      u1 = u1 as ControlType2;
      u2 = u2 as ControlType2;
  }
  
  SomeMethod(u1.SelectedItemName, u2.SelectedItemName);
  </code></pre>
  
  <p>Since UserControl doesn't have a property called "SelectedItemName", the code would not throw error.</p>
  
  <p>What I've currently done is, I've added an extension method on UserControl which gets the "SelectedItemName" using reflection, and I get the value by calling u1.SelectedItemName() instead of u1.SelectedItemName;</p>
  
  <p>My question is what is an easy way to fix this without using extension/ maybe the right way. Note that I don't want to repeat the SomeMethod(a,b) inside the if statement.</p>