Archive for August, 2009

DevReach 2009 Registration is open

DevReach 2009The registration for the fourth edition of the premier conference on Microsoft Technologies in Southeastern Europe - DevReach is open!

With over of 45 sessions and speakers like Chris Sells, a Program Manager for the Business Platform Division in Microsoft, Microsoft Regional Director Christian Weyer, the INETA Country Leader for Sweden Tiberiu Covaci, Richard Campbell, a .NET Rocks and Run As Radio fame, Telerik Chief Technical Evangelist Todd Anglin, Telerik Chief Strategy Officer Stephen Forte, Shawn Wildermuth and many more it will be difnitely a lot of fun again this year.

The event will be held in Sofia, Bulgaria so if you are somewhere near around 12 October don’t hesitate to join!

Add comment Friday, August 7, 2009

Code generation for Resources in Silverlight (and how to get rid of the internal constructor)

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’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.

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:


OK, nothing special yet.

What you will notice is that you still can’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’t need a constructor. But that’s not the case here. We want to use the resources in XAML so it has to create an instance of this class.

Of course a possible solution is to open the generated class, change the modifier from internal to public and that’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.

The resource class is automatically generated by a custom tool called PublicResXFileCodeGenerator (in case of public code generation). Guy Smith-Ferrier created another custom tool that behaves just like this one, except that it generates a public constructor. Read Guy’s post and download his tool to fix future problems with resources.

Add comment Thursday, August 6, 2009



August 2009
« Jul   Sep »

Recent Posts