views:

37

answers:

1

I have a RESX resource file that I can retrieve the values out of using the strongly typed properties and assign to values in my Silverlight 3 app. However at runtime I need to generate the lookup key based on some values to avoid a ton of if/switch statements. I'm trying to use the ResourceManager, but it doesn't like .resx files.

Searched far and wide... is this just not possible in SL3? Does anyone have another suggestion?

+1  A: 

Couldn't you just use reflection on the strongly typed property class created by the resx generator?

Jeff Wilcox
Not sure I follow...
AC
There is a type, probably in a subnamespace Properties, that corresponds to your RESX file. It uses Resource Manager under the covers. To dynamically grab items you don't know the name of at build time, use reflection: http://msdn.microsoft.com/en-us/library/f7ykdhsy(VS.95).aspx
Jeff Wilcox
Sorry... I get Reflection :) I hadn't seen that approach and was a bit surprised this is a possible work around... just didn't seem like it would be that complex. I'll fall back to this. Thanks Jeff.
AC