title: How to initiate a class without using "new" keyword?
body: <p>This might be a stupid question, but I'm developing a component and I have a class with a property like the following</p>
  
  <pre><code>public class Grid()
  {
   ..
   public IDecorator Decorator { get; set;}
  
  }
  </code></pre>
  
  <p>What I want is for user to specify their own custom class that implements IDecorator in the following way</p>
  
  <pre><code>...BuildGrid(
  grid=&gt;{
  ..
  grid.Decorator =  [CustomNameSpace].[DecoratorClass] 
  //as in 
  grid.Decorator =  Com.MyCompany.DivDecorator
  ..
  });
  </code></pre>
  
  <p>Com.MyCompany.DivDecorator implements IDecorator interface.  So how should I do it without the end user to specify the "new" keyword as in </p>
  
  <pre><code>grid.Decorator = new Com.MyCompany.DivDecorator();
  </code></pre>
  
  <p>I know I'm missing some key c# concept here. </p>
  
  <p>Thanks</p>
  
  <p>[Edit]</p>
  
  <p>I was trying to do something like the Java DisplayTag library located here</p>
  
  <p><a href="http://www.displaytag.org/1.2/tut_decorators.html" rel="nofollow">http://www.displaytag.org/1.2/tut_decorators.html</a></p>
  
  <p>The way they do it is by </p>
  
  <p>... <code>decorator="org.displaytag.sample.Wrapper"</code></p>
  
  <p>So I guess instead of </p>
  
  <pre><code>public IDecorator Decorator { get; set;}
  </code></pre>
  
  <p>I should do </p>
  
  <pre><code>public String Decorator (get; set;}
  </code></pre>
  
  <p>and then internally use TypeOf() to resolve it.... Just wondering if there is any other way to elegantly do it in C#. </p>
  
  <p>Thanks</p>