Silverlight telerik Control Learning: Theme Switching

Source: Internet
Author: User
Telerik's radcontrols for Silverlight has the following built-in theme styles:

Office black-this is the default value and does not need to load any other DLL files.
Office blue-telerik. Windows. Themes. office_blue.dll.
Office silver-telerik. Windows. Themes. office_silver.dll.
Summer-you need to reference telerik. Windows. Themes. Summer. dll.
Vista-you need to reference telerik. Windows. Themes. Vista. dll.
Windows 7-you need to reference telerik. Windows. Themes. windows7.dll.
Transparent-you need to reference telerik. Windows. Themes. Transparent. dll

The following is a switchover method:

1. Local switchover/configuration method<Telerik: radbutton Height = "20" width = "80" content = "pop-up"Telerik: stylemanager. theme = "windows7"Click = "radbutton_click"/> This is like the inline style in CSS. It only affects the current control.

2. Global switch/configuration method . XAML. add a line of Code to the app constructor In the CS file. refer to the following: Public app ()
{< br> stylemanager. applicationtheme = new windows7theme ();
This. startup + = This. application_startup;
This. exit + = This. application_exit;
This. unhandledexception + = This. application_unhandledexception; initializecomponent ();
}this is like a global CSS file referenced by link ref in the web page creation

3. Custom themes if you are not satisfied with the built-in themes, you can also customize them, the method is as follows: first define a topic class Public class customtheme: telerik. windows. controls. theme
{< BR >} then specify source Public customtheme ()
{< br> This . source = New uri ( "/telerik. windows. themes. customtheme; component/themes/generic. XAML " , urikind. relative);
} the things that follow are exactly the same as those mentioned in 1, 2.

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.