8 Answers, 1 is accepted
The StyleManager class that ships with our controls possesses the Theme attached property that attaches to all our UI controls. You can change the theme of a control by changing that property. I'm attaching a sample solution where I've bound the Theme property of a RadGridView to a ComboBox of themes and choosing a different theme from the ComboBox changes the theme of the GridView.
Sincerely yours,Yavor Georgiev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
<telerikRibbonBar:RadRibbonBar telerik:StyleManager.Theme="Office_Silver" Grid.ColumnSpan="2" Height="175" HorizontalAlignment="Left" x:Name="radRibbonBar1" VerticalAlignment="Top" Width="989" ApplicationName="myAppl Web" ApplicationButtonImageSource="/RibbonbarNavigationPOC;component/Images/myimg.png" Grid.RowSpan="2" SelectedTabChanged="radRibbonBar1_SelectedTabChanged"> |
...... |
Note: I'm using the trial version
I'm asked to be able to create a theme that i could apply to the ribbon bar(or the whole silverlight app), that theme has to be in a .xaml file so it could be like a standard theme that could be used later on.
so what I was thinking of doing was using any of your themes, modify it's style, than copy the style to a resource dictionary file, then apply it when needed, if it is possible.
now if I can't even change the theme statically, i'm stuck...
please help...
<UserControl x:Class="SilverlightApplication3.MainPage" |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
xmlns:controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" |
xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input" |
mc:Ignorable="d" |
d:DesignHeight="300" d:DesignWidth="400" xmlns:telerikRibbonBar="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.RibbonBar"> |
<UserControl.Resources> |
<Style TargetType="TextBox" controls:StyleManager.BasedOn="Office_BlackTheme"> |
</Style> |
</UserControl.Resources> |
<StackPanel x:Name="LayoutRoot" Background="White"> |
<TextBox Text="SomeText"/> |
<telerikRibbonBar:RadRibbonBar controls:StyleManager.Theme="Summer" Height="100" Name="radRibbonBar1" Width="398" /> |
</StackPanel> |
</UserControl> |
If you want to create a new theme, you will have to package it in a separate assembly, as outlined here.
However, if you only want to style several elements, you can do so with XAML Styles, there's no need to create a whole custom theme and try to apply it with the telerik StyleManager.
We provide the source code of our themes in our RadControls for Silverlight package. You can find them in the Themes folder in your RadControls for Silverlight installation folder. They are a good place to start building custom themes.
Also, when setting themes in Silverlight, make sure you reference the relevant theme's assembly.
Please don't hesitate to contact us with any further inquiries.
Yavor Georgiev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.