8 Answers, 1 is accepted
Actually, our themes provide styles for some of the standard controls, however, there is no style for the textbox control at the moment. We will consider enhancing the range of standard controls that are stylized by our themes for the upcoming Q2 release due in the summer.
Regards,
Kaloyan
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Because of this the carret in the textbox stays black, which makes it difficult to see. Changing the carret brush manually has a nasty side effect in our code that it will sometimes simply disappear (i suppose it gets the same color as the textbox itself.
Is this a bug in the Expression dark theme?
You may simply set the CaretBrush of the TextBox to match the corresponding default Foreground for Expression_Dark theme and everything will work as expected:
<
TextBox
CaretBrush
=
"#FFd2d2d2"
Width
=
"150"
FontSize
=
"26"
telerik:StyleManager.Theme
=
"Expression_Dark"
/>
Can you verify how this works for you?
Regards,
Vanya Pavlova
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Hi Vanya,
Surely this will work. I'm already applying this technique.But in fact this means that we are unable to let the user switch themes as we "hard code" every TextBlock control to use one theme.
I also tried this (in app.xaml) but it's not working (surprisingly, it does work for less frequently used controls like a CheckBox):
...
<telerik:Expression_DarkTheme IsApplicationTheme="True" x:Key="Theme" />
<Style TargetType="TextBlock" telerik.StyleManager.BasedOn="{StaticResource Theme}">
...
Why is this not working for a very common control like the textbox or is there a more general approach so i am able to provide the possibility to switch themes on the fly, and most importantly, not having to set the CaretBrush on every textbox control?
Best Regards,
Peter
I would like to shed some light on that matter. Keep in mind that the Telerik themes can be applied to the following native Silverlight controls:
1.System.Windows.Button
2.System.Windows.CheckBox
3.System.Windows.ListBox
4.System.Windows.RadioButton
5.System.Windows.ScrollViewer
6.System.Windows.PasswordBox
7.System.Windows.RepeatButton
8.System.Windows.TextBox
The TextBlock is not included in this list, since an implicit style targeted at TextBlock will style all text elements within your application. Setting an application wide theme will be evaluated at runtime.
When you apply the theme at runtime indeed only RadControls will be styled - not the native ones, which are being supported by our theming mechanism. If you want to style these native controls based on the current application theme you should manually set the corresponding theme, as shown below:
App.xaml:
<
Application
xmlns
=
"http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
x:Class
=
"RadTest.App"
>
<
Application.Resources
>
<
Style
TargetType
=
"TextBox"
>
<
Setter
Property
=
"CaretBrush"
Value
=
"#FFD2D2D2"
/>
</
Style
>
</
Application.Resources
>
</
Application
>
App.xaml.cs:
public
App()
{
this
.Startup +=
this
.Application_Startup;
this
.Exit +=
this
.Application_Exit;
this
.UnhandledException +=
this
.Application_UnhandledException;
StyleManager.ApplicationTheme =
new
Expression_DarkTheme();
InitializeComponent();
StyleManager.SetBasedOn(((Style)Current.Resources[
typeof
(TextBox)]), StyleManager.ApplicationTheme);
}
Will you verify how this works for you?
Greetings,
Vanya Pavlova
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
I have tried to reproduce this exception, however I was not able to. Can you point us to the exact version of our controls you are currently using? You may also use the attached project, which I used for testing for further reference. Feel free to modify it in the way you need and send it back to us as attachment in a new support ticket.
Vanya Pavlova
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
it does not change the style in the Textbox.
thanks.