Just found a cool trick.

0 views
Skip to first unread message

Mike Brown

unread,
Jul 21, 2008, 11:54:50 AM7/21/08
to wpf-di...@googlegroups.com
If you declare a Func<T> (or one of its siblings) as a Property on a class consumers of that class can invoke that property as if it was a declared function on the class.
 
You can then have another object responsible for implementing the function and setting the value on an instance of the class. I know it was possible to do this with delegates...but delegates required you to explicitly define them. I'm using this trick to create a non-intrusive O/RM framework.
Reply all
Reply to author
Forward
0 new messages