TextBox apply default Theme

6 posts, 0 answers
  1. Jaroslav Půbal
    Jaroslav Půbal avatar
    52 posts
    Member since:
    Dec 2009

    Posted 20 Oct 2011 Link to this post

    Hello,
    I read many post in this forum, but still not have answer.

    How to apply current telerik theme to TextBox?
    So no hardcoded theme but current theme.

    We have function like this:
    internal static void ApplyConfiguredTheme()
           {
               switch (GetConfiguredTheme())
               {
                   case ThemeEnum.Black:
                       StyleManager.ApplicationTheme = new Office_BlackTheme();
                       break;
                   case ThemeEnum.Blue:
                       StyleManager.ApplicationTheme = new Office_BlueTheme();
                       break;
                   case ThemeEnum.Silver:
                       StyleManager.ApplicationTheme = new Office_SilverTheme();
                       break;
                   case ThemeEnum.Win7:
                       StyleManager.ApplicationTheme = new Windows7Theme();
                       break;
               }
           }

    So in XAML I cant hardcode any theme.

  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 21 Oct 2011 Link to this post

    Hi Jaroslav Půbal,

     

    When you set the theme at an application theme level it will be applied only to RadControls/WPF, not to the native ones. The TextBox, CheckBox, Button etc.. would not be styled in this way. What you may do is to programmatically set the theme for the TextBox controls after setting the global application theme. 
    You should set directly the theme for these based on your current application theme and they will be styled correctly. 



    Best wishes,
    Vanya Pavlova
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. Jaroslav Půbal
    Jaroslav Půbal avatar
    52 posts
    Member since:
    Dec 2009

    Posted 27 Oct 2011 Link to this post

    Hello,
    must I set theme for every single TextBox or it can be done for all TextBox in my app at once?
  4. Jaroslav Půbal
    Jaroslav Půbal avatar
    52 posts
    Member since:
    Dec 2009

    Posted 21 Nov 2011 Link to this post

    Thank you for your answer.

    Is it possible do it in XAML only?

  5. Jaroslav Půbal
    Jaroslav Půbal avatar
    52 posts
    Member since:
    Dec 2009

    Posted 21 Nov 2011 Link to this post

    Thank you for your answer.

    Is it possible do it in XAML only?

  6. Jaroslav Půbal
    Jaroslav Půbal avatar
    52 posts
    Member since:
    Dec 2009

    Posted 21 Nov 2011 Link to this post

    Thank you for your answer.

    Is it possible do it in XAML only?

Back to Top