<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	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>Emil Stoychev &#187; Localization</title>
	<atom:link href="http://estoychev.wordpress.com/category/silverlight/localization/feed/" rel="self" type="application/rss+xml" />
	<link>http://estoychev.wordpress.com</link>
	<description>A few things on Silverlight, technology and the community</description>
	<lastBuildDate>Sat, 31 Dec 2011 01:20:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='estoychev.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Emil Stoychev &#187; Localization</title>
		<link>http://estoychev.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://estoychev.wordpress.com/osd.xml" title="Emil Stoychev" />
	<atom:link rel='hub' href='http://estoychev.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Code generation for Resources in Silverlight (and how to get rid of the internal constructor)</title>
		<link>http://estoychev.wordpress.com/2009/08/06/code-generation-for-resources-in-silverlight-and-how-to-get-rid-of-the-internal-constructor/</link>
		<comments>http://estoychev.wordpress.com/2009/08/06/code-generation-for-resources-in-silverlight-and-how-to-get-rid-of-the-internal-constructor/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 06:17:44 +0000</pubDate>
		<dc:creator>Emil</dc:creator>
				<category><![CDATA[Localization]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://emil.silverlightshow.net/?p=34</guid>
		<description><![CDATA[Localization and internationalization have never been great in Silverlight, but are totally possible and kind of easy with a bit of manual work. There are a lot of articles out there focused on localization so I won&#8217;t dig deep in that. Instead, I want to make a note about the generated code for the resources [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=estoychev.wordpress.com&amp;blog=560331&amp;post=34&amp;subd=estoychev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Localization and internationalization have never been great in Silverlight, but are totally possible and kind of easy with a bit of manual work.</p>
<p>There are a lot of articles out there focused on localization so I won&#8217;t dig deep in that. Instead, I want to make a note about the generated code for the resources and especially the nasty internal constructor.</p>
<p>By default, when you add a new resource, the generated code is internal. However, if you want to use the resources in XAML then you can go with Public access modifier:</p>
<p><img class="alignnone size-full wp-image-35" title="public_access_modifier" src="http://estoychev.files.wordpress.com/2009/08/public_access_modifier.png?w=480" alt="public_access_modifier"   /></p>
<p>OK, nothing special yet.</p>
<p>What you will notice is that you still can&#8217;t use the resources, because the constructor of the generated class is internal. All properties that are generated are static and in most cases you don&#8217;t need a constructor. But that&#8217;s not the case here. We want to use the resources in XAML so it has to create an instance of this class.</p>
<p>Of course a possible solution is to open the generated class, change the modifier from internal to public and that&#8217;s it. Well, yes, but you have to do this every time you add/update a resource in your file. Developers are lazy these days so I know you want something that can automate this process.</p>
<p>The resource class is automatically generated by a custom tool called PublicResXFileCodeGenerator (in case of public code generation). <a href="http://www.guysmithferrier.com/default.aspx">Guy Smith-Ferrier</a> created another custom tool that behaves just like this one, except that it generates a public constructor. Read <a href="http://www.guysmithferrier.com/post/2008/09/Silverlight-And-Strongly-Typed-Resource-Classes.aspx">Guy&#8217;s post</a> and download his tool to fix future problems with resources.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/estoychev.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/estoychev.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/estoychev.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/estoychev.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/estoychev.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/estoychev.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/estoychev.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/estoychev.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/estoychev.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/estoychev.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/estoychev.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/estoychev.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/estoychev.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/estoychev.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=estoychev.wordpress.com&amp;blog=560331&amp;post=34&amp;subd=estoychev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://estoychev.wordpress.com/2009/08/06/code-generation-for-resources-in-silverlight-and-how-to-get-rid-of-the-internal-constructor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/60b6e0e9c77fb9b03c9bca73a6eda119?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Emil</media:title>
		</media:content>

		<media:content url="http://estoychev.files.wordpress.com/2009/08/public_access_modifier.png" medium="image">
			<media:title type="html">public_access_modifier</media:title>
		</media:content>
	</item>
	</channel>
</rss>
