Greg, not 100% sure about SL as I am more WPF worldly, but I would think you'll 
likely need to programmatically assign the appropriate ResourceDictionary(s) 
after login.

something.Resources.MergedDictionaries.Add(somesource.GetResourceDictionaryForUser());

where 'something' is your app or a particular window or control etc. and 
'somesource' is either assembly internal as in Resource files, or a WebService 
proxy etc?

If its a Xaml string from a Web Service you may need to use SL's equivalent of 
the XamlReader class to read in the String and cast to a ResourceDictionary as 
follows (at least for WPF):

ResourceDictionary rd = XamlReader.Load(s) as ResourceDictionary;
  (rd != null)
{
     //etc, etc
}

Hope this helps,
Dan.

From: Greg Keogh 
Sent: Monday, June 21, 2010 2:17 PM
To: 'ozSilverlight' 
Subject: Dynamic themes and resources


Folks, it's an action-packed day, I just received word that my SL3 app will 
soon need to have a feature to assign a different appearance and different 
string resources according to who is authenticated (via the initial login 
screen).

 

I took precautions to allow the app to have a different appearance and strings 
in different installations, but I wasn't really prepared to cater for the more 
granular approach of changing appearance for different logins.

 

The strings are all in a spreadsheet-style resource file, so that's only a 
minor problem for me. However, dynamically changing themes is more frightening 
as I haven't needed to do that before. I've tried to be neat with my styles and 
put them in the controls or in the App page, but I feel that to get dynamic 
themes  in Silverlight I will have to be ultra-strict and use clever binding.

 

I'm just not sure of the best way to structure the styles and templates 
globally within the app to make theming easier. I'm going to search to web 
article guidance on this, but I'm keen to hear from anyone who's done this 
before and has some tips and tricks to share.

 

Cheers,

Greg



--------------------------------------------------------------------------------


_______________________________________________
ozsilverlight mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight
_______________________________________________
ozsilverlight mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight

Reply via email to