使用Telerik StyleMananger 改变Silverlight Button样式
Telerik 支持更改以下控件样式
- System.Windows.Button
- System.Windows.ScrollViewer
- System.Windows.CheckBox
- System.Windows.TextBox
- System.Windows.RadioButton
- System.Windows.ListBox
- System.Windows.PasswordBox
- System.Windows.RepeatButton
- System.Windows.Tooltip
需要在App.Xaml中的修改,红色是添加的代码
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
x:Class="TestDemo.App"
>
<Application.Resources>
<Style TargetType="Button"/>
</Application.Resources>
</Application>
在后台程序中修改,其中红色是需要添加的代码
public App() { this.Startup += this.Application_Startup; this.Exit += this.Application_Exit; this.UnhandledException += this.Application_UnhandledException; StyleManager.ApplicationTheme = new Windows7Theme(); InitializeComponent(); StyleManager.SetBasedOn(((Style)Current.Resources[typeof(Button)]), StyleManager.ApplicationTheme); }
posted on 2014-05-05 17:14 lovezj9012 阅读(313) 评论(0) 收藏 举报
浙公网安备 33010602011771号