title: Pass object property as parameter and access it
body: <p>I have looked through all SO answers to this question but haven't found a single appealing answer. I am trying to create a TextFilter class for generating simple observable collection filters for string based properties. Here is what I have in mind:</p>
  
  <pre><code>public class TextFilter : IFilter
  {
     Func&lt;string&gt; Property;
     string Target { get; set; }
  
     public TextFilter(Func&lt;string&gt;property, string target)
     {
        Property = property;
        Target = target;
     }
  
     public bool Filter(object item)
     {
        return ((MyObject)item).***Property***.Contains(Target);
      }
  }
  </code></pre>
  
  <p>However I cannot find a way to pass my properties and access them afterwards?</p>