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

Office theme, double border od NumericUpDown

2 Answers 12 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Lukasz
Top achievements
Rank 1
Lukasz asked on 06 Apr 2021, 06:38 AM

In my WPF application, I'm using Office theme (2016 or 2019). It causes that some of controls I'm using has an odd style. For example,  Xceed DoubleUpDown/IntegerUpDown etc. has an additional internal border. I'd like to avoid overriding the entire control template.

 

How to solve this problem?

Thanks!

2 Answers, 1 is accepted

Sort by
0
Vladimir Stoyanov
Telerik team
answered on 06 Apr 2021, 11:16 AM

Hello Lukasz,

Thank you for the shared image. 

I am assuming that you are using implicit styling with the NoXaml dlls. In that case the UI for WPF themes have a ResourceDictionary with styles for some native WPF controls (TextBox, Button etc). If these controls are part of another element (for example the specified DoubleUpDown/IntegerUpDown controls), the styles will be implicitly applied to them. 

You can find some more information about that in the following article: Setting a Theme on MS Controls. If you avoid merging the System.Windows.xaml ResourceDictionary, the styles of the MS controls will not be affected. 

Alternatively, if you want to style the MS controls but want to avoid applying the style on the children of that particular control, you can add an empty style targeting the MS control that is affected. In the scenario from the picture it seems that this is a TextBox:

<telerik:RadButton.Resources>
                <Style TargetType="TextBox" />
</telerik:RadButton.Resources>

I hope you find this information helpful.

Regards,
Vladimir Stoyanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Lukasz
Top achievements
Rank 1
answered on 07 Apr 2021, 10:16 AM

I'm afraid that we're not able override this control's style in that way. I've tried to define style that override values of some properties, but it didn't work. It worked only for IsReadOnly and IsEnabled properties. I think it is caused by control template defined in  generic.xaml of UpDown controls.I've tried to redefine part template of entire control TextBox and Spinner and it worked.

 

Thank you for your quick reponse!

Tags
General Discussions
Asked by
Lukasz
Top achievements
Rank 1
Answers by
Vladimir Stoyanov
Telerik team
Lukasz
Top achievements
Rank 1
Share this question
or