Page 1 of 2

StiWpfViewer changing element styles (label, TextBox, GroupBox, Menus)

Posted: Mon Mar 02, 2020 4:20 pm
by Delacroxpp
Hello friends, I am using the most updated version of Stimulsoft for WPF.

Previously we had the 2017 version, these days we have updated to version 02.2020 and in our WPF projects, when opening Viwer, the elements of all windows are changed, it is as if StiWpfViwer changed the styles of the system in general, how should I proceed in this situation? can someone help?

Re: StiWpfViewer changing element styles (label, TextBox, GroupBox, Menus)

Posted: Thu Mar 05, 2020 10:42 pm
by Lech Kulikowski
Hello,

Could you explain your issue in more detail, screenshots?

Thank you.

Re: StiWpfViewer changing element styles (label, TextBox, GroupBox, Menus)

Posted: Mon Mar 09, 2020 12:38 pm
by ivar
We have the same issue after upgrading to 2020.2.1
See the attachments.

Re: StiWpfViewer changing element styles (label, TextBox, GroupBox, Menus)

Posted: Thu Mar 12, 2020 8:46 am
by ivar
It would be nice to get some feedback on this. Apparently more users are having this issue.

Re: StiWpfViewer changing element styles (label, TextBox, GroupBox, Menus)

Posted: Sun Mar 15, 2020 9:54 pm
by Lech Kulikowski
Hello,

Please clarify which product are you use. On the screenshots is not our product elements.

Thank you.

Re: StiWpfViewer changing element styles (label, TextBox, GroupBox, Menus)

Posted: Sun Mar 15, 2020 10:20 pm
by ivar
Clearly I was reacting on the original post:
Previously we had the 2017 version, these days we have updated to version 02.2020 and in our WPF projects, when opening Viwer, the elements of all windows are changed, it is as if StiWpfViwer changed the styles of the system in general, how should I proceed in this situation? can someone help?
The screenshots are showing the impact on our styling before we load a stireport report control and after we loaded the control. This is only the case with 2020.2.1. We currently use 2019.4 and have been using older versions before this without this behavior.

I think it's because of this new setting: StiOptions.Wpf.LoadThemeMode

I used both options without success.

Re: StiWpfViewer changing element styles (label, TextBox, GroupBox, Menus)

Posted: Sun Mar 15, 2020 10:40 pm
by Lech Kulikowski
Hello,

Please send us a sample project which reproduces the issue for analysis.

Thank you.

Re: StiWpfViewer changing element styles (label, TextBox, GroupBox, Menus)

Posted: Tue Mar 17, 2020 2:36 pm
by ivar
Attached project reproduces the issue. Open with VS2019

See the MainWindowViewModel.cs for this piece of code:

Code: Select all

 // This option breaks the styling of the Telerik tab control
 //StiOptions.Wpf.LoadThemeMode = StiLoadThemeMode.OnceForTheWholeApp;

 // This option seems to work
 StiOptions.Wpf.LoadThemeMode = StiLoadThemeMode.ForEveryOpenedWindow;
 
In my opinion the default option 'StiLoadThemeMode.OnceForTheWholeApp' shouldn't change the height of the tab control header.

Re: StiWpfViewer changing element styles (label, TextBox, GroupBox, Menus)

Posted: Thu Mar 19, 2020 10:40 am
by Lech Kulikowski
Hello,

That behavior is correct. If uses
StiLoadThemeMode.OnceForTheWholeApp
then the theme is loaded once globally for the entire application, so all the controls will change depending on the theme. It's the right behavior, there's nothing to be done. That's how WPF works.

You can use the second option:
StiLoadThemeMode.ForEveryOpenedWindow

Thank you.

Re: StiWpfViewer changing element styles (label, TextBox, GroupBox, Menus)

Posted: Thu Mar 19, 2020 11:03 am
by ivar
No that is not how WPF works. A 3rd party control should never change the styling of controls that aren't part of their own library.

Imagine you would reference a control I made and I changed the padding globally for all controls. How would you like that?
So yes you can load your styling once but no you shouldn't change the style of any control you don't own.