In this article we will see how we can
reduce Silverlight application xap size. As you know themes are provided by
Silverlight Toolkit. But if you include multiple themes your application would
be too big.Finding Silverlight Themes In Local
Once you install Silverlight Toolkit, all the theme styles
are copied to your local folder. You can find it in following
path: C:\Program Files\Microsoft
Now suppose you
need a theme style from Shiny Red a Shiny Blue for two different
Open the related xaml in Visual Studio IDE.
Button and you will be navigated to Button Style.
Copy the Button Style
to your App.xaml.
Don't forget to copy the namespaces too.
a x:Key value to the Style in our case BlueStyle and RedStyle.
StaticResource constants and change the key appropriately. (You have change it
carefully where you are using it.)
Here is the Xaml for the blue theme
Now open the solution in Expression Blend
Add two Buttons to the Application.
Select First Button and
Apply the Style.
you can use the Red themer and apply it to the Red Button.
Now you need
to change the Static Resource names carefully where it is being used and
Now it's ready. Run your application, it will run faster than
you like this tweak.