<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Property Delegates with Anonymous Methods</title>
	<atom:link href="http://www.csharp411.com/property-delegates-with-anonymous-methods/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.csharp411.com/property-delegates-with-anonymous-methods/</link>
	<description>C# Information, Code, Tips and News</description>
	<lastBuildDate>Sat, 24 Jul 2010 01:26:51 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: --</title>
		<link>http://www.csharp411.com/property-delegates-with-anonymous-methods/comment-page-1/#comment-5499</link>
		<dc:creator>--</dc:creator>
		<pubDate>Tue, 25 May 2010 19:06:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.mini-tools.com/at2/csharp/wordpress/property-delegates-with-anonymous-methods/#comment-5499</guid>
		<description>@Daniel Earwicker

What you write is true, but off the mark.  I think what they&#039;re looking for is delegate for a property, not a delegate that uses a property.  Something that captures both the getter and setter. For example, to bind the delegated property to a control.</description>
		<content:encoded><![CDATA[<p>@Daniel Earwicker</p>
<p>What you write is true, but off the mark.  I think what they're looking for is delegate for a property, not a delegate that uses a property.  Something that captures both the getter and setter. For example, to bind the delegated property to a control.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Earwicker</title>
		<link>http://www.csharp411.com/property-delegates-with-anonymous-methods/comment-page-1/#comment-5431</link>
		<dc:creator>Daniel Earwicker</dc:creator>
		<pubDate>Thu, 15 Apr 2010 10:42:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.mini-tools.com/at2/csharp/wordpress/property-delegates-with-anonymous-methods/#comment-5431</guid>
		<description>@Ed Rowland:

In C# 3.0 if you want to make a delegate that obtains a property value, all you have to say is:

() =&gt; person.FirstName;

For example:

Func&lt;string&gt; getter = () =&gt; person.FirstName;

Console.WriteLine(getter());

Similarly to capture the setter:

Action&lt;string&gt; setter = v =&gt; person.FirstName = v;

Lambda syntax is so succinct that it makes many common scenarios very readable without the need for dozens of special syntaxes.

I think the real lazy people are those who don&#039;t bother to learn about the various things the C# designers got right! :)</description>
		<content:encoded><![CDATA[<p>@Ed Rowland:</p>
<p>In C# 3.0 if you want to make a delegate that obtains a property value, all you have to say is:</p>
<p>() =&gt; person.FirstName;</p>
<p>For example:</p>
<p>Func&lt;string&gt; getter = () =&gt; person.FirstName;</p>
<p>Console.WriteLine(getter());</p>
<p>Similarly to capture the setter:</p>
<p>Action&lt;string&gt; setter = v =&gt; person.FirstName = v;</p>
<p>Lambda syntax is so succinct that it makes many common scenarios very readable without the need for dozens of special syntaxes.</p>
<p>I think the real lazy people are those who don't bother to learn about the various things the C# designers got right! <img src='http://www.csharp411.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ed rowland</title>
		<link>http://www.csharp411.com/property-delegates-with-anonymous-methods/comment-page-1/#comment-5430</link>
		<dc:creator>ed rowland</dc:creator>
		<pubDate>Wed, 14 Apr 2010 03:29:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.mini-tools.com/at2/csharp/wordpress/property-delegates-with-anonymous-methods/#comment-5430</guid>
		<description>Expectations exceeded. Second try:

public static Func&lt;T&gt; GetPropertyDelegate
(object obj, string name)
{
return (Func&lt;T&gt;)  Delegate.CreateDelegate(typeof(Func&lt;T&gt;),obj,methodName);
}</description>
		<content:encoded><![CDATA[<p>Expectations exceeded. Second try:</p>
<p>public static Func&lt;T&gt; GetPropertyDelegate<br />
(object obj, string name)<br />
{<br />
return (Func&lt;T&gt;)  Delegate.CreateDelegate(typeof(Func&lt;T&gt;),obj,methodName);<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ed rowland</title>
		<link>http://www.csharp411.com/property-delegates-with-anonymous-methods/comment-page-1/#comment-5429</link>
		<dc:creator>ed rowland</dc:creator>
		<pubDate>Wed, 14 Apr 2010 03:27:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.mini-tools.com/at2/csharp/wordpress/property-delegates-with-anonymous-methods/#comment-5429</guid>
		<description>Excuse the formatting. No reasonable expectation that the results will be readable, but I do the best I can.

public static Func GetPropertyDelegate
(object obj, string name)
{
return FuncDelegate.CreateDelegate(typeof(Func),obj,methodName);
}

Not typesafe, but when you actually need a property delegate it makes do.

This would be about #3 on my list of shocking laziness on the part of c# designers.</description>
		<content:encoded><![CDATA[<p>Excuse the formatting. No reasonable expectation that the results will be readable, but I do the best I can.</p>
<p>public static Func GetPropertyDelegate<br />
(object obj, string name)<br />
{<br />
return FuncDelegate.CreateDelegate(typeof(Func),obj,methodName);<br />
}</p>
<p>Not typesafe, but when you actually need a property delegate it makes do.</p>
<p>This would be about #3 on my list of shocking laziness on the part of c# designers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Gatch</title>
		<link>http://www.csharp411.com/property-delegates-with-anonymous-methods/comment-page-1/#comment-4865</link>
		<dc:creator>Greg Gatch</dc:creator>
		<pubDate>Tue, 26 May 2009 12:38:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.mini-tools.com/at2/csharp/wordpress/property-delegates-with-anonymous-methods/#comment-4865</guid>
		<description>Some really usefull information here if you pay attention, thanks</description>
		<content:encoded><![CDATA[<p>Some really usefull information here if you pay attention, thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Timm</title>
		<link>http://www.csharp411.com/property-delegates-with-anonymous-methods/comment-page-1/#comment-58</link>
		<dc:creator>Timm</dc:creator>
		<pubDate>Thu, 20 Dec 2007 19:00:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.mini-tools.com/at2/csharp/wordpress/property-delegates-with-anonymous-methods/#comment-58</guid>
		<description>To my knowledge, C# v3.5 does not support property delegates as a language feature, hence a workaround (like the one above) is still required.</description>
		<content:encoded><![CDATA[<p>To my knowledge, C# v3.5 does not support property delegates as a language feature, hence a workaround (like the one above) is still required.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris J.</title>
		<link>http://www.csharp411.com/property-delegates-with-anonymous-methods/comment-page-1/#comment-59</link>
		<dc:creator>Chris J.</dc:creator>
		<pubDate>Thu, 20 Dec 2007 17:24:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.mini-tools.com/at2/csharp/wordpress/property-delegates-with-anonymous-methods/#comment-59</guid>
		<description>Any idea if property delegates are supported in C# 3.0?  And if not, whether new workarounds are possible?</description>
		<content:encoded><![CDATA[<p>Any idea if property delegates are supported in C# 3.0?  And if not, whether new workarounds are possible?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
