<?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: A Universal Value Converter for WPF</title>
	<atom:link href="http://www.scottlogic.co.uk/blog/colin/2010/07/a-universal-value-converter-for-wpf/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.scottlogic.co.uk/blog/colin/2010/07/a-universal-value-converter-for-wpf/</link>
	<description>Colin Eberhardt&#039;s Adventures in .NET</description>
	<lastBuildDate>Thu, 09 Feb 2012 03:02:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: JoshEinstein.com &#187; Archive &#187; Another multi-purpose value converter for WPF</title>
		<link>http://www.scottlogic.co.uk/blog/colin/2010/07/a-universal-value-converter-for-wpf/#comment-52749</link>
		<dc:creator>JoshEinstein.com &#187; Archive &#187; Another multi-purpose value converter for WPF</dc:creator>
		<pubDate>Fri, 29 Apr 2011 01:16:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.scottlogic.co.uk/blog/colin/?p=726#comment-52749</guid>
		<description>[...] Eberhardt has posted a neat multi-purpose value converter that tries various conventional conversion methods to convert from one type to another. This [...]</description>
		<content:encoded><![CDATA[<p>[...] Eberhardt has posted a neat multi-purpose value converter that tries various conventional conversion methods to convert from one type to another. This [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mahmudul Haque Azad</title>
		<link>http://www.scottlogic.co.uk/blog/colin/2010/07/a-universal-value-converter-for-wpf/#comment-43258</link>
		<dc:creator>Mahmudul Haque Azad</dc:creator>
		<pubDate>Thu, 24 Feb 2011 10:54:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.scottlogic.co.uk/blog/colin/?p=726#comment-43258</guid>
		<description>Very nicely written on an innovative technique!</description>
		<content:encoded><![CDATA[<p>Very nicely written on an innovative technique!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin Eberhardt</title>
		<link>http://www.scottlogic.co.uk/blog/colin/2010/07/a-universal-value-converter-for-wpf/#comment-18708</link>
		<dc:creator>Colin Eberhardt</dc:creator>
		<pubDate>Mon, 06 Sep 2010 15:39:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.scottlogic.co.uk/blog/colin/?p=726#comment-18708</guid>
		<description>There was a good reason, although I cannot remember what it was ... I really should have added a comment. Remove it, try it, and see what happens!</description>
		<content:encoded><![CDATA[<p>There was a good reason, although I cannot remember what it was &#8230; I really should have added a comment. Remove it, try it, and see what happens!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon Draht</title>
		<link>http://www.scottlogic.co.uk/blog/colin/2010/07/a-universal-value-converter-for-wpf/#comment-18474</link>
		<dc:creator>Simon Draht</dc:creator>
		<pubDate>Fri, 03 Sep 2010 08:41:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.scottlogic.co.uk/blog/colin/?p=726#comment-18474</guid>
		<description>Hi Colin,
thanks for sharing this, I have not known before, how much I needed such a converter ;)
It will definitely help me to reduce and DRY my code.

Did you (or anybode else) encounter caught exceptions using this converter, and if so, is it important to not throw them?
I really dislike the try-catch-swallow passage, so I would like to get rid of it before using the converter. But maybe there is a good reason for it?

Regards,
Simon</description>
		<content:encoded><![CDATA[<p>Hi Colin,<br />
thanks for sharing this, I have not known before, how much I needed such a converter <img src='http://www.scottlogic.co.uk/blog/colin/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
It will definitely help me to reduce and DRY my code.</p>
<p>Did you (or anybode else) encounter caught exceptions using this converter, and if so, is it important to not throw them?<br />
I really dislike the try-catch-swallow passage, so I would like to get rid of it before using the converter. But maybe there is a good reason for it?</p>
<p>Regards,<br />
Simon</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin Eberhardt</title>
		<link>http://www.scottlogic.co.uk/blog/colin/2010/07/a-universal-value-converter-for-wpf/#comment-15857</link>
		<dc:creator>Colin Eberhardt</dc:creator>
		<pubDate>Mon, 12 Jul 2010 19:18:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.scottlogic.co.uk/blog/colin/?p=726#comment-15857</guid>
		<description>@Andrej,

Yes - sorry about that, I really need to look into preserving XAML in comments.

Anyhow, you are quite correct, with that added bit of XAML you can achieve the same thing. Now let&#039;s see you do the same trick for the Path.Data property? ;-)

Regards, Colin E.</description>
		<content:encoded><![CDATA[<p>@Andrej,</p>
<p>Yes &#8211; sorry about that, I really need to look into preserving XAML in comments.</p>
<p>Anyhow, you are quite correct, with that added bit of XAML you can achieve the same thing. Now let&#8217;s see you do the same trick for the Path.Data property? <img src='http://www.scottlogic.co.uk/blog/colin/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Regards, Colin E.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrej Tozon &#124; @andrejt</title>
		<link>http://www.scottlogic.co.uk/blog/colin/2010/07/a-universal-value-converter-for-wpf/#comment-15848</link>
		<dc:creator>Andrej Tozon &#124; @andrejt</dc:creator>
		<pubDate>Mon, 12 Jul 2010 17:21:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.scottlogic.co.uk/blog/colin/?p=726#comment-15848</guid>
		<description>Sorry for double post, the code got cut off.

(Rectangle)
  (Rectangle.Fill)
    {SolidColorBrush Color=&quot;{Binding MyColorProperty}&quot; /)
  (/Rectangle.Fill)
(/Rectangle)</description>
		<content:encoded><![CDATA[<p>Sorry for double post, the code got cut off.</p>
<p>(Rectangle)<br />
  (Rectangle.Fill)<br />
    {SolidColorBrush Color=&#8221;{Binding MyColorProperty}&#8221; /)<br />
  (/Rectangle.Fill)<br />
(/Rectangle)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrej Tozon &#124; @andrejt</title>
		<link>http://www.scottlogic.co.uk/blog/colin/2010/07/a-universal-value-converter-for-wpf/#comment-15847</link>
		<dc:creator>Andrej Tozon &#124; @andrejt</dc:creator>
		<pubDate>Mon, 12 Jul 2010 17:16:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.scottlogic.co.uk/blog/colin/?p=726#comment-15847</guid>
		<description>Hi Colin,
nice use of TypeConverters, but in your first, Fill/ColorToBrushConverter example, you don&#039;t really need a converter, do you? My thoughts were you can easily set it directly, like:


  
    
  
</description>
		<content:encoded><![CDATA[<p>Hi Colin,<br />
nice use of TypeConverters, but in your first, Fill/ColorToBrushConverter example, you don&#8217;t really need a converter, do you? My thoughts were you can easily set it directly, like:</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Strobel</title>
		<link>http://www.scottlogic.co.uk/blog/colin/2010/07/a-universal-value-converter-for-wpf/#comment-14720</link>
		<dc:creator>Mike Strobel</dc:creator>
		<pubDate>Sat, 10 Jul 2010 22:56:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.scottlogic.co.uk/blog/colin/?p=726#comment-14720</guid>
		<description>@Philipp Well, the performance impact may be minimal, but it becomes more significant when your binding is applied to every item in an ItemsControl.  The overhead isn&#039;t so much in the time to instantiate a new converter, but a result of the ensuing memory fragmentation and increased garbage collection time.

Is &quot;{c:UniversalValueConverter}&quot; really that much cleaner than &quot;{x:Static c:UniversalValueConverter.Instance}&quot;?  I&#039;d say it&#039;s a little cleaner, but still pretty clean.

FYI, I actually use both approaches, depending on the scenario.  All of my value converters use a generic ValueConverter base class, which is based on MarkupExtension *and* provides a static, lazily-initialized singleton instance.  ValueConverter implements both IValueConverter and IMultiValueConverter.  Here&#039;s the code, if you&#039;re interested:

http://supremacy.codeplex.com/SourceControl/changeset/view/51713#708507

Cheers,
Mike</description>
		<content:encoded><![CDATA[<p>@Philipp Well, the performance impact may be minimal, but it becomes more significant when your binding is applied to every item in an ItemsControl.  The overhead isn&#8217;t so much in the time to instantiate a new converter, but a result of the ensuing memory fragmentation and increased garbage collection time.</p>
<p>Is &#8220;{c:UniversalValueConverter}&#8221; really that much cleaner than &#8220;{x:Static c:UniversalValueConverter.Instance}&#8221;?  I&#8217;d say it&#8217;s a little cleaner, but still pretty clean.</p>
<p>FYI, I actually use both approaches, depending on the scenario.  All of my value converters use a generic ValueConverter base class, which is based on MarkupExtension *and* provides a static, lazily-initialized singleton instance.  ValueConverter implements both IValueConverter and IMultiValueConverter.  Here&#8217;s the code, if you&#8217;re interested:</p>
<p><a href="http://supremacy.codeplex.com/SourceControl/changeset/view/51713#708507" rel="nofollow">http://supremacy.codeplex.com/SourceControl/changeset/view/51713#708507</a></p>
<p>Cheers,<br />
Mike</p>
]]></content:encoded>
	</item>
</channel>
</rss>

