<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments for The Tranxition Developer Blog</title>
	<atom:link href="http://tranxcoder.wordpress.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://tranxcoder.wordpress.com</link>
	<description>Random musings from the developers at Tranxition</description>
	<lastBuildDate>Tue, 22 Dec 2009 16:50:22 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Customizing &#8220;lookful&#8221; WPF controls &#8211; Take 2 by hempelcx</title>
		<link>http://tranxcoder.wordpress.com/2008/10/12/customizing-lookful-wpf-controls-take-2/#comment-158</link>
		<dc:creator>hempelcx</dc:creator>
		<pubDate>Tue, 22 Dec 2009 16:50:22 +0000</pubDate>
		<guid isPermaLink="false">http://tranxcoder.wordpress.com/2008/10/12/customizing-lookful-wpf-controls-take-2/#comment-158</guid>
		<description>Thanks for the comment, Marcel.

Sice &quot;a non-zero margin applies space outside the element layout&#039;s ActualWidth and ActualHeight&quot; (http://bit.ly/6K25fI) you shouldn&#039;t need to take that into account for CalculateIsTextTrimmed. Padding is an interesting issue, however, as well as any render transforms which may be applied to the TextBlock (and may or may not be applied when CalculateIsTextTrimmed executes.) I haven&#039;t tested the proposed algorithm against either scenario, but I expect it will fail under both.

This solution is suboptimal and would definitely be better served by a custom control allowing access to MeasureOverride and ArrangeOverride. In this case, most of us are just looking for a clean hack to overcome the lookful nature of the TextBlock control when that&#039;s the only option.

If you have a revised general purpose algorithm which you believe covers more cases, please post it in the comments!</description>
		<content:encoded><![CDATA[<p>Thanks for the comment, Marcel.</p>
<p>Sice &#8220;a non-zero margin applies space outside the element layout&#8217;s ActualWidth and ActualHeight&#8221; (<a href="http://bit.ly/6K25fI" rel="nofollow">http://bit.ly/6K25fI</a>) you shouldn&#8217;t need to take that into account for CalculateIsTextTrimmed. Padding is an interesting issue, however, as well as any render transforms which may be applied to the TextBlock (and may or may not be applied when CalculateIsTextTrimmed executes.) I haven&#8217;t tested the proposed algorithm against either scenario, but I expect it will fail under both.</p>
<p>This solution is suboptimal and would definitely be better served by a custom control allowing access to MeasureOverride and ArrangeOverride. In this case, most of us are just looking for a clean hack to overcome the lookful nature of the TextBlock control when that&#8217;s the only option.</p>
<p>If you have a revised general purpose algorithm which you believe covers more cases, please post it in the comments!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Customizing &#8220;lookful&#8221; WPF controls &#8211; Take 2 by Marcel Kunz</title>
		<link>http://tranxcoder.wordpress.com/2008/10/12/customizing-lookful-wpf-controls-take-2/#comment-157</link>
		<dc:creator>Marcel Kunz</dc:creator>
		<pubDate>Mon, 21 Dec 2009 16:07:27 +0000</pubDate>
		<guid isPermaLink="false">http://tranxcoder.wordpress.com/2008/10/12/customizing-lookful-wpf-controls-take-2/#comment-157</guid>
		<description>If you want to set Padding and Margin to the TextBlock you must subtract them from the textblock size in the CalculateIsTextTrimmed method.</description>
		<content:encoded><![CDATA[<p>If you want to set Padding and Margin to the TextBlock you must subtract them from the textblock size in the CalculateIsTextTrimmed method.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on A Generic Factory in C# by Bryan Ray</title>
		<link>http://tranxcoder.wordpress.com/2008/07/11/a-generic-factory-in-c/#comment-156</link>
		<dc:creator>Bryan Ray</dc:creator>
		<pubDate>Fri, 30 Oct 2009 13:52:19 +0000</pubDate>
		<guid isPermaLink="false">http://tranxcoder.wordpress.com/2008/07/11/a-generic-factory-in-c/#comment-156</guid>
		<description>Definitely a good use of Reflection and an excellent walk through for understanding how to refactor your code and look for &quot;code smells.&quot;

I would, however, agree with hempelcx and cgassib that you&#039;re very much going towards a Dependency Injection solution. There&#039;s a lot of &quot;support&quot; code there that has to be maintained and rather than focusing on your application you&#039;re having to focus on something that a DI container could do for you.

Take a look at Ninject, Unity, Autofac, Spring.NET, etc. There&#039;s a handful of good DI libraries out there.

I only say this for future readers who are looking. Other than that it&#039;s a great article, man. 

Thanks.</description>
		<content:encoded><![CDATA[<p>Definitely a good use of Reflection and an excellent walk through for understanding how to refactor your code and look for &#8220;code smells.&#8221;</p>
<p>I would, however, agree with hempelcx and cgassib that you&#8217;re very much going towards a Dependency Injection solution. There&#8217;s a lot of &#8220;support&#8221; code there that has to be maintained and rather than focusing on your application you&#8217;re having to focus on something that a DI container could do for you.</p>
<p>Take a look at Ninject, Unity, Autofac, Spring.NET, etc. There&#8217;s a handful of good DI libraries out there.</p>
<p>I only say this for future readers who are looking. Other than that it&#8217;s a great article, man. </p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on A Generic Factory in C# by cgassib</title>
		<link>http://tranxcoder.wordpress.com/2008/07/11/a-generic-factory-in-c/#comment-155</link>
		<dc:creator>cgassib</dc:creator>
		<pubDate>Thu, 08 Oct 2009 20:15:55 +0000</pubDate>
		<guid isPermaLink="false">http://tranxcoder.wordpress.com/2008/07/11/a-generic-factory-in-c/#comment-155</guid>
		<description>I agree.  It sounds like the route you&#039;re heading is leaning more towards a Dependency Injection approach.</description>
		<content:encoded><![CDATA[<p>I agree.  It sounds like the route you&#8217;re heading is leaning more towards a Dependency Injection approach.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on A Generic Factory in C# by hempelcx</title>
		<link>http://tranxcoder.wordpress.com/2008/07/11/a-generic-factory-in-c/#comment-154</link>
		<dc:creator>hempelcx</dc:creator>
		<pubDate>Thu, 08 Oct 2009 06:37:02 +0000</pubDate>
		<guid isPermaLink="false">http://tranxcoder.wordpress.com/2008/07/11/a-generic-factory-in-c/#comment-154</guid>
		<description>arno,

To me that&#039;s starting to sound a lot like a plugin or extension framework. Personally, I would consider either a &lt;a href=&quot;http://www.hanselman.com/blog/ListOfNETDependencyInjectionContainersIOC.aspx&quot; rel=&quot;nofollow&quot;&gt;Dependency Injection Container&lt;/a&gt; or Microsoft&#039;s &lt;a href=&quot;http://www.codeplex.com/MEF&quot; rel=&quot;nofollow&quot;&gt;Managed Extensibility Framework&lt;/a&gt; depending on how far you want to take it.</description>
		<content:encoded><![CDATA[<p>arno,</p>
<p>To me that&#8217;s starting to sound a lot like a plugin or extension framework. Personally, I would consider either a <a href="http://www.hanselman.com/blog/ListOfNETDependencyInjectionContainersIOC.aspx" rel="nofollow">Dependency Injection Container</a> or Microsoft&#8217;s <a href="http://www.codeplex.com/MEF" rel="nofollow">Managed Extensibility Framework</a> depending on how far you want to take it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Customizing &#8220;lookful&#8221; WPF controls &#8211; Take 2 by jan</title>
		<link>http://tranxcoder.wordpress.com/2008/10/12/customizing-lookful-wpf-controls-take-2/#comment-153</link>
		<dc:creator>jan</dc:creator>
		<pubDate>Wed, 07 Oct 2009 20:06:59 +0000</pubDate>
		<guid isPermaLink="false">http://tranxcoder.wordpress.com/2008/10/12/customizing-lookful-wpf-controls-take-2/#comment-153</guid>
		<description>oh never mind, i figured it out.
sorry for the spam =)</description>
		<content:encoded><![CDATA[<p>oh never mind, i figured it out.<br />
sorry for the spam =)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Customizing &#8220;lookful&#8221; WPF controls &#8211; Take 2 by jan</title>
		<link>http://tranxcoder.wordpress.com/2008/10/12/customizing-lookful-wpf-controls-take-2/#comment-151</link>
		<dc:creator>jan</dc:creator>
		<pubDate>Wed, 07 Oct 2009 19:18:11 +0000</pubDate>
		<guid isPermaLink="false">http://tranxcoder.wordpress.com/2008/10/12/customizing-lookful-wpf-controls-take-2/#comment-151</guid>
		<description>Hi! Thanks for this post. I downloaded the project file and it works on the multi-line but not if there&#039;s just one word in it and Trimming = ”CharacterEllipsis” as Kevin noted above. Do you have an updated project file?
Thanks</description>
		<content:encoded><![CDATA[<p>Hi! Thanks for this post. I downloaded the project file and it works on the multi-line but not if there&#8217;s just one word in it and Trimming = ”CharacterEllipsis” as Kevin noted above. Do you have an updated project file?<br />
Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Customizing &#8220;lookful&#8221; WPF controls &#8211; Take 2 by Richard Jones</title>
		<link>http://tranxcoder.wordpress.com/2008/10/12/customizing-lookful-wpf-controls-take-2/#comment-150</link>
		<dc:creator>Richard Jones</dc:creator>
		<pubDate>Wed, 07 Oct 2009 08:12:57 +0000</pubDate>
		<guid isPermaLink="false">http://tranxcoder.wordpress.com/2008/10/12/customizing-lookful-wpf-controls-take-2/#comment-150</guid>
		<description>To solve the problem with calculating IsTextTrimmed when the field contains a single word, a simpler solution is to add the line:
formattedText.Trimming = TextTrimming.None
after
formattedText.MaxTextWidth = textBlock.ActualWidth
(rather than Kevin&#039;s extra code from August 8th). This means that formattedText&#039;s height always increases if its content needs to wrap around.

I have another problem: The IsTextTrimmed property is recalculated if the textblock size is changed (e.g. if the UI is resized). However, it doesn&#039;t get recalculated if the textblock&#039;s content is changed. I&#039;m using binding to set the textblock&#039;s value, and IsTextTrimmed is calculated correctly when the field is displayed initially. However if the underlying Text value is then changed to something else, IsTextTrimmed doesn&#039;t get recalculated (unless you jiggle the edge of the UI!)

It seems that where we register the handler for the SizeChangedEvent, we also need to do something similar for when the Text property&#039;s value is changed.
I&#039;ve tried various things but haven&#039;t found an elegant solution. Any ideas?</description>
		<content:encoded><![CDATA[<p>To solve the problem with calculating IsTextTrimmed when the field contains a single word, a simpler solution is to add the line:<br />
formattedText.Trimming = TextTrimming.None<br />
after<br />
formattedText.MaxTextWidth = textBlock.ActualWidth<br />
(rather than Kevin&#8217;s extra code from August 8th). This means that formattedText&#8217;s height always increases if its content needs to wrap around.</p>
<p>I have another problem: The IsTextTrimmed property is recalculated if the textblock size is changed (e.g. if the UI is resized). However, it doesn&#8217;t get recalculated if the textblock&#8217;s content is changed. I&#8217;m using binding to set the textblock&#8217;s value, and IsTextTrimmed is calculated correctly when the field is displayed initially. However if the underlying Text value is then changed to something else, IsTextTrimmed doesn&#8217;t get recalculated (unless you jiggle the edge of the UI!)</p>
<p>It seems that where we register the handler for the SizeChangedEvent, we also need to do something similar for when the Text property&#8217;s value is changed.<br />
I&#8217;ve tried various things but haven&#8217;t found an elegant solution. Any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on A Generic Factory in C# by -arno-</title>
		<link>http://tranxcoder.wordpress.com/2008/07/11/a-generic-factory-in-c/#comment-149</link>
		<dc:creator>-arno-</dc:creator>
		<pubDate>Mon, 28 Sep 2009 12:50:51 +0000</pubDate>
		<guid isPermaLink="false">http://tranxcoder.wordpress.com/2008/07/11/a-generic-factory-in-c/#comment-149</guid>
		<description>Hello,
i developped quite the same thing (~not generic :( ), some time ago, and i&#039;m now facing a new problem with this approach : i want my factory to build an inherited objet declared in a different assembly...the only way i found until now is to make my factory parse every assmebly available in a specific folder in order to find every &quot;type&quot; that would match my object interface... not very clean. Would you have an idea to solve this ?</description>
		<content:encoded><![CDATA[<p>Hello,<br />
i developped quite the same thing (~not generic <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  ), some time ago, and i&#8217;m now facing a new problem with this approach : i want my factory to build an inherited objet declared in a different assembly&#8230;the only way i found until now is to make my factory parse every assmebly available in a specific folder in order to find every &#8220;type&#8221; that would match my object interface&#8230; not very clean. Would you have an idea to solve this ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Customizing &#8220;lookful&#8221; WPF controls &#8211; Take 2 by STEVE F</title>
		<link>http://tranxcoder.wordpress.com/2008/10/12/customizing-lookful-wpf-controls-take-2/#comment-148</link>
		<dc:creator>STEVE F</dc:creator>
		<pubDate>Wed, 16 Sep 2009 19:11:15 +0000</pubDate>
		<guid isPermaLink="false">http://tranxcoder.wordpress.com/2008/10/12/customizing-lookful-wpf-controls-take-2/#comment-148</guid>
		<description>Anyone have code for this working in a textbox.
If so could you email it to me at steve_44@inbox.com</description>
		<content:encoded><![CDATA[<p>Anyone have code for this working in a textbox.<br />
If so could you email it to me at <a href="mailto:steve_44@inbox.com">steve_44@inbox.com</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
