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

TextBox apply default Theme

5 Answers 161 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jaroslav Půbal
Top achievements
Rank 1
Jaroslav Půbal asked on 20 Oct 2011, 04:41 PM
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.

5 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 21 Oct 2011, 08:42 AM
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 >>

0
Jaroslav Půbal
Top achievements
Rank 1
answered on 27 Oct 2011, 11:11 PM
Hello,
must I set theme for every single TextBox or it can be done for all TextBox in my app at once?
0
Jaroslav Půbal
Top achievements
Rank 1
answered on 21 Nov 2011, 03:11 PM

Thank you for your answer.

Is it possible do it in XAML only?

0
Jaroslav Půbal
Top achievements
Rank 1
answered on 21 Nov 2011, 03:11 PM

Thank you for your answer.

Is it possible do it in XAML only?

0
Jaroslav Půbal
Top achievements
Rank 1
answered on 21 Nov 2011, 03:13 PM

Thank you for your answer.

Is it possible do it in XAML only?

Tags
General Discussions
Asked by
Jaroslav Půbal
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Jaroslav Půbal
Top achievements
Rank 1
Share this question
or