This is a migrated thread and some comments may be shown as answers.

Setting theme from style

10 Answers 249 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 26 Feb 2010, 11:42 AM
Is there any way to set attached property "telerik:StyleManager.Theme" on MS textbox from style? I tried this way:

<Style TargetType="TextBox"
        <Setter Property="telerik:StyleManager.Theme" Value="Office_Black"/> 
</Style> 


but it doesn't work.



10 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 26 Feb 2010, 12:57 PM
Hello Alex,

Please find attached an example.

If you have further questions please do not hesitate to ask us.
I hope this will help you.

Regards,
Dimitrina
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.
0
Alex
Top achievements
Rank 1
answered on 26 Feb 2010, 02:20 PM
Thank you for an example - It works well. But I can't get it worked on SL4 beta. I need to use it in implicit style (it's a new feature in SL4) in this manner:

<UserControl x:Class="SilverlightProject.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:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
     
    <UserControl.Resources> 
        <Style TargetType="TextBox"   telerik:StyleManager.BasedOn="Office_BlackTheme"
        </Style> 
    </UserControl.Resources>    
  <Grid x:Name="LayoutRoot"
        <TextBox Text="TextBox" /> 
  </Grid> 
</UserControl> 


It seems that this feature doesn't work in beta. Can you confirm it?


0
Accepted
Bobi
Telerik team
answered on 04 Mar 2010, 12:38 PM
Hi Alex,

Please find attached  a sample project that demonstrates the desired functionality.
In it you can find the assemblies from the last internal build.

All the best,
Bobi
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.
0
Alex
Top achievements
Rank 1
answered on 04 Mar 2010, 12:49 PM
Thanks a lot, it works well now.
0
royalblue
Top achievements
Rank 1
answered on 23 May 2010, 11:13 AM
How can I do in Silverlight 4 ?

This sample run on Silverlight 3 successfully but in Silverlight 4 don't run.

(I use RadControls_for_Silverlight_4_2010_1_0422_TRIAL_hotfix  TRIAL dll's)
0
Alex
Top achievements
Rank 1
answered on 24 May 2010, 05:56 AM
What do you mean? How does it "don't run"? I've checked last sample (silverlightapplication3-2.zip) again - it works well. It successfully compiles and runs. At runtime it implicitly use defined style - textbox border becomes orange when textbox in focus. I recompiled the project with 2010.1.422.1040 dlls.
0
Tina Stancheva
Telerik team
answered on 27 May 2010, 09:21 AM
Hello Serdar YILMAZ,

The solution works as expected with the RadControls_for_Silverlight_4_2010_1_0422_TRIAL_hotfix .dlls on our side.

Please take a look at the attached project and let us know if it works for you or if you need more info.

Greetings,
Tina Stancheva
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.
0
Riia
Top achievements
Rank 1
answered on 22 Dec 2010, 06:43 AM
Hi,

I would like to ask few questions related to setting theme from style.

For some reason I wasn't able to use StyleManager:BasedOn but using following I was able to set style for RadGridView
<Setter Property="telerik:StyleManager.Theme" Value="Windows7"/>
    
In addition to that I would like to set some other properties from style but if I define for example BorderBrush and BorderThickness after setting theme they do not apply to the grid. Should I be able to set both theme and also other properties in the same style?

Is there any documentation related to this?

Best regards,
Riia
0
Vanya Pavlova
Telerik team
answered on 23 Dec 2010, 03:14 PM
Hi Alex,

 
Considering the theming mechanism you can use these styles but the changes will be applied against the default Office_Black theme. However if you need to change a style related to a specific theme you need to get the specific theme template and its resources and apply the changes on your own. 
I believe that the following article "Modifying built-in Theme" would be helpful for you on that matter.

Regards,
Vanya Pavlova
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Jeff
Top achievements
Rank 1
answered on 20 Mar 2013, 06:56 PM
How would one achieve this for the WPF controls? The BasedOn property doesn't seem to exist for StyleManager in WPF.

UPDATE: Nevermind I figured it out myself. Looks like another special case of a feature created to make up for deficits in Silverlight when compared to features of WPF. For those who might care this can be achieved simply in WPF by using the following syntax.

<Style BasedOn="{StaticResource {telerik:ThemeResourceKey ThemeType=telerik:VistaTheme, ElementType=telerik:RadComboBox}}" />
Tags
General Discussions
Asked by
Alex
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Alex
Top achievements
Rank 1
Bobi
Telerik team
royalblue
Top achievements
Rank 1
Tina Stancheva
Telerik team
Riia
Top achievements
Rank 1
Vanya Pavlova
Telerik team
Jeff
Top achievements
Rank 1
Share this question
or