Ashok N

Ashok N

  • NA
  • 10
  • 12.6k

Reg: Silverlight Applying themes dynamically at runtime through code

Apr 30 2010 12:41 AM
Hi all,
 I am working on silverlight 4.0. I am facing a problem with applying dynamic themes to my application. Please go through below and send me your solutions -

Problem:
------------------
In my application I have three ResourceDictionary files -
  1. Default.xaml
  2. Theme1.xaml
  3. Theme2.xaml
In all above files I 2 style keys mentioned below and three buttons.
  1. x:Key="ButtonStyle"
  2. x:Key="LayoutRootGridStyle"
I have given x:Key="ButtonStyle" to only one button. My requirement is if click on three buttons all the buttons and text boxes styles are changing. but the both x:key styles are not changing. Please tell me the problem and solution asap.

In my main application I am using may borders and grids if I give the styles with out key the style applying to all. I don't want that. I just want to apply styles to given key only.

Thanks in advance.

Answers (2)