Silverlight Tookit provides many cool cutting and easy-to-use theme styles, including
- Bureau black
- Bureau blue
- Expression dark
- Expression light
- Rainier purple
- Rainier orange
- Shiny blue
- Shiny red
- Whistler blue
You can view the theme styles and Demos here.
The following describes how to apply these styles to the Silverlight control.
Step 1 Add a reference to the topic Style
- In solution, right-click "Reference" and select "add reference"
- Find the Silverlight Tookit directory, such as D: \ silverlighttookit \ Binaries
- Add Microsoft. Windows. Controls. theming
- In the following description, we will use the red theme style, so we also need to add Microsoft. Windows. Controls. theming. shinyred. dll in the binaries \ themes folder.
Step 2 declare a namespace
- Open page. XAML and add the following declaration for the usercontrol node to reference the shinyred style component.
<UserControl xmlns:basics="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data" x:Class="SilverlightDemo.Page" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="900" Height="625" xmlns:shinyRed="clr-namespace:Microsoft.Windows.Controls.Theming;assembly=Microsoft.Windows.Controls.Theming.ShinyRed" >
Step 3 apply the style to the control
- Add a style Declaration for the control you want to apply the style.
<Canvas> <shinyred: shinyredtheme> <button content = "Welcome to 4mvc" width = "80"> </button> </shinyred: shinyredtheme> </canvas>
Success!