Exactly what I was going to say.

 

Here is the link:

http://www.silverlight.net/content/samples/sl3/toolkitcontrolsamples/run/def
ault.html#/Welcome.xaml

 

Or for SL4:

http://www.silverlight.net/content/samples/sl4/toolkitcontrolsamples/run/def
ault.html

 

If you go and click on the theme browser on the left, you will see that they
do change the look and feel on the run. 

 

Here is the link for downloading the source code: (take a look at the zip
file)

http://silverlight.codeplex.com/releases/view/43528

 

 

 

Regards,

 

TJ Gokcen | Sydney, Australia | Mobile: +61 400 355 811

 

From: [email protected]
[mailto:[email protected]] On Behalf Of .net noobie
Sent: Monday, June 21, 2010 3:22 PM
To: ozSilverlight
Subject: Re: Dynamic themes and resources

 

Greg have you looked at the Themes from the SL toolkit

you can make your own and you can theme you entire app just by wrapping the
mainpage rootlayout grid

 

then you can just dynamically set this and change the style/theme for your
app in a single location

On Mon, Jun 21, 2010 at 2:51 PM, <[email protected]> wrote:

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.GetResourceDictionaryF
orUser());

 

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 <mailto:[email protected]>  

Sent: Monday, June 21, 2010 2:17 PM

To: 'ozSilverlight' <mailto:[email protected]>  

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

 

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

Reply via email to