Theme - support for MS standard Controls

7 posts, 0 answers
  1. xuan
    xuan avatar
    7 posts
    Member since:
    Mar 2009

    Posted 16 Mar 2009 Link to this post

    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?
  2. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 16 Mar 2009 Link to this post

    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.
  3. xuan
    xuan avatar
    7 posts
    Member since:
    Mar 2009

    Posted 16 Mar 2009 Link to this post

    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> 


  4. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 17 Mar 2009 Link to this post

    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.
  5. xuan
    xuan avatar
    7 posts
    Member since:
    Mar 2009

    Posted 17 Mar 2009 Link to this post

    Thanks a lot for your reply. I have applied succeed as I want.
  6. Ulrich
    Ulrich avatar
    1 posts
    Member since:
    Jan 2009

    Posted 24 Jul 2009 Link to this post

    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?
  7. Boyan
    Admin
    Boyan avatar
    758 posts

    Posted 28 Jul 2009 Link to this post

    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.
Back to Top