[Silverlight] How to Use the theme style in the Silverlight toolkit in an application

Source: Internet
Author: User

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.