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

Theme - support for MS standard Controls

6 Answers 402 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
xuan
Top achievements
Rank 1
xuan asked on 16 Mar 2009, 09:38 AM
Hi ! I applied theme for my silverlight application as the following
Telerik.Windows.Controls.StyleManager.ApplicationTheme = Telerik.Windows.Controls.ThemeManager.FromName("Vista");
But this theme doesn't influence to MS standard Controls. Do this theme not support for MS Standard Controls?

6 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 16 Mar 2009, 10:06 AM
Hi xuan,

Yes our themes include styles for MS controls but you have to set them explicitly like this:
<UserControl x:Class="SilverlightDockingDemo.Page53" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls">  
    <UserControl.Resources> 
        <telerik:Theme x:Key="vistaTheme" 
                Source="/Telerik.Windows.Themes.Vista;component/Themes/generic.xaml" /> 
    </UserControl.Resources> 
    <Grid x:Name="LayoutRoot" Background="White">  
        <Button telerik:StyleManager.Theme="{StaticResource vistaTheme}" /> 
    </Grid> 
</UserControl> 

Let me know if you need more information.

Regards,
Hristo
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
xuan
Top achievements
Rank 1
answered on 17 Mar 2009, 02:00 AM
Thanks for your answer! I applied succeed with your solution. Now I has more question.
.  If I want to change the theme Vista to an another theme what should I do?. Such as RainierPurple theme. can It change as the following code in MS standard control.

Uri uri = new Uri(@"SilverlightPrototype;component/ThemeBrowser/RainierPurple.xaml", UriKind.Relative);

                ImplicitStyleManager.SetResourceDictionaryUri(LayoutRootSt, uri);

                ImplicitStyleManager.SetApplyMode(LayoutRootSt, ImplicitStylesApplyMode.Auto);

                ImplicitStyleManager.Apply(LayoutRootSt);


<UserControl.Resources> 
        <telerik:Theme x:Key="vistaTheme" 
                Source="/Telerik.Windows.Themes.Vista;component/Themes/generic.xaml" /> 
    </UserControl.Resources> 
    <Grid x:Name="LayoutRoot" Background="White">  
        <Button telerik:StyleManager.Theme="{StaticResource vistaTheme}" /> 
    </Grid> 
</UserControl> 


0
Hristo
Telerik team
answered on 17 Mar 2009, 08:46 AM

Hi xuan,

We have supplied three themes - Vista, Summer and the default Office_Black.

Using ImplicitStyleManager wouldn't have effect over RadControls for Silverlight because in RainierPurple there are no style defined for our controls.
If you have xaml file with styles that you have defined or customized you can still use Theme class and set its source to the xaml file. This way you can set this xaml to be your application theme or you can apply this theme to some controls.
Here is how to define theme with custom xaml file:

<telerik:Theme x:Key="customTheme"   
Source="/YourAssembly;component/PathToTheXAMLFile.xaml" />    
       
 

In my previous post you can see how to apply it to some controls.
If you want to make it a global (application) theme you can set IsApplicationTheme=true.

Do not hesitate to contact us in case you have more questions.

Greetings,

Hristo
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
xuan
Top achievements
Rank 1
answered on 17 Mar 2009, 10:11 AM
Thanks a lot for your reply. I have applied succeed as I want.
0
Ulrich
Top achievements
Rank 1
answered on 24 Jul 2009, 09:02 AM
Hi,

if I do apply a telerik style to a standard control (in my case it is a TextBox) which is placed on a telerik control (RadPane, RadTabItem, ...) then I have to click twice on it to get the input focus to the control. Is this a known problem? What can I do?
0
Boyan
Telerik team
answered on 28 Jul 2009, 04:29 PM
Hi Ulrich,

I tested the issue but was not able to reproduce it. Could you please send us a simple project that can help us reproduce the issue. I tested it with 2 Textboxes in a RadPane and set them Vista and Summer theme and they were working fine.

Regards,
Boyan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
xuan
Top achievements
Rank 1
Answers by
Hristo
Telerik team
xuan
Top achievements
Rank 1
Ulrich
Top achievements
Rank 1
Boyan
Telerik team
Share this question
or