title: How to implement a Properties window style control/system in Windows Forms?
body: <p>So what I am trying to do is to have a set UI with certain controls, and I want to have some class instance to fill in the values.</p>
  
  <p>For instance:</p>
  
  <p>Classes that can populate the UI:</p>
  
  <pre><code>Sharpen, Blur, Smear, ... : FilterBase
  </code></pre>
  
  <p>So whenever the user creates an instances of the above classes, I want to automatically fetch the values based on the UI controls, by using the class instance.</p>
  
  <p>The UI has items like:</p>
  
  <pre><code>.Name (TextBox)
  .Amount (NumericUpDown)
  .Decay (NumericUpDown)
  </code></pre>
  
  <p>So if the current instance is <code>s = new Sharpen()</code>, I want to get s.Name to fill out UI.Name.</p>
  
  <p>How do I do this in the best possible way? Elegancy, clarity, performance wise, etc.</p>
  
  <p>I am gonna use reflection, but how do I store the instance of the object (Sharpen, ...) and be type safe? Should I use an <code>System.Object</code> instead? Or T?</p>
  
  <pre><code>public partial class ParamsUI
  {
      T CurrentFilter (?)
      ...
  }
  </code></pre>
  
  <p>Also if I use T, how will I know what to cast it to?</p>
  
  <p>Is there a better way?</p>