Switching Themes and applying global style on TextBox fails

Hi,
I have a .NET Framework 4.8 WPF project where i'm switching themes. Now i want to globally apply a style to TextBox with Resources. But on switching theme the control style of the TextBox is lost and it only shows a white TextBox. This affects also other controls like PasswordBox. I have attached a sample application when you switch to certain themes like DarkBlue you can see the problem. Have you a solution for this? Thanks!
Best regards
Christoph Weller

Attachment: WpfApp1_879d3345.zip

3 Replies

UN Unknown Syncfusion Team April 14, 2020 10:55 AM UTC

Hi Christoph, 

Thanks for contacting Syncfusion support. 

We have checked your query “When apply the theme , the style set for TextBox globally is reset” but we are unable to reproduce the reported issue. Please refer the below sample and let us know if we are missing any details(current Syncfusion version). If so, please share us those information as they will be useful in providing solution at earliest. 

Note : Our product is supported in .NET Framework versions 4.0 ,4.5 and 4.6 only. 


Screenshot : 
 

Regards, 
Niranjan Kumar Gopalan 
 



CW Christoph Weller April 14, 2020 02:15 PM UTC

Hi Niranjan,

Sorry i didn't explained it correctly. The style defined in app.xaml will be successfully be aplied to all text boxes. But when applying a style to the textboxes, they will lost all their design styles. You can see it in your screenshot, the first text box with no style applied has a black background and a underline. The second textbox with style applied is just an white textbox with no design. That is what i mean. Do you know how to fix this?

Regards
Christoph


UN Unknown Syncfusion Team April 15, 2020 12:22 PM UTC

Hi Christoph, 

Thanks for your update. 

We have checked your query “When style is set to TextBox , applied theme is not updated in that TextBox” and this is the default behavior of WPF controls. When a theme is applied , it is updated to all controls in the window. But when you create and apply style manually to a control it overrides the applied theme style and updates only the style you have set manually. As a result the TextBox for which the style is set appears white. Please let us know if you have further queries. 

Regards, 
Niranjan Kumar Gopalan  


Loader.
Up arrow icon