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

Stimulsoft Reports.WPF discussion
Delacroxpp
Posts: 1
Joined: Tue Jan 31, 2017 12:36 pm

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

Post 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?
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

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

Post by Lech Kulikowski »

Hello,

Could you explain your issue in more detail, screenshots?

Thank you.
ivar
Posts: 21
Joined: Tue Aug 04, 2015 11:41 am

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

Post by ivar »

We have the same issue after upgrading to 2020.2.1
See the attachments.
Attachments
before.png
before.png (18.75 KiB) Viewed 4986 times
after.png
after.png (21.08 KiB) Viewed 4986 times
before.png
before.png (18.75 KiB) Viewed 4987 times
ivar
Posts: 21
Joined: Tue Aug 04, 2015 11:41 am

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

Post by ivar »

It would be nice to get some feedback on this. Apparently more users are having this issue.
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

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

Post by Lech Kulikowski »

Hello,

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

Thank you.
ivar
Posts: 21
Joined: Tue Aug 04, 2015 11:41 am

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

Post 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.
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

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

Post by Lech Kulikowski »

Hello,

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

Thank you.
ivar
Posts: 21
Joined: Tue Aug 04, 2015 11:41 am

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

Post 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.
Attachments
StimulsoftWpfStyleIssue.zip
(2.31 MiB) Downloaded 314 times
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

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

Post 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.
ivar
Posts: 21
Joined: Tue Aug 04, 2015 11:41 am

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

Post 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.
Post Reply