Hello Everyone,
I’m making a modification to a device developed with Version 9.0.0 of Embedded Wizard, and I have the following problem:
The modification requires me to add several styles to the interface, and these styles must be “fixed”, meaning they won’t be selectable by the user, but predefined during the manufacturing process
I am required to keep the device's Firmware "unique", meaning I can’t use the mechanism that allows me to associate a graphic style with a Profile Configuration and manage it statically — I must necessarily handle styles dynamically, so the device must be able to recognize its own version via software and draw the GUI accordingly, using the correct colors, icons and fonts.
The solution I tried to implement is as follows:
In the “Init” method of Application::Application, the first thing I do is call a method that asks the Middleware which style to use for the GUI, and based on the value returned, I set the GUI style by changing the "styles" variable.
However, since the function ApplicationApplication__Init has already been executed, this call seems to have no effect until I interact with a component. After the interaction ends, the component takes on the correct appearance.
If I navigate to a different page of the GUI, that page is in the correct style, but when I return to the Main Menu, the problem persists.
I tried using the InvalidateViewState() method, but at best I end up with a situation where some components are redrawn correctly and others are not. I’m attaching some screenshots to explain better.
I also tried following the instructions I found in some questions on this forum and in the documentation, but with no luck.
I’m aware that in Embedded Wizard 9.00 changing the style dynamically has no effect on components that have already been initialized, and I’d like to know if there is a way to force the reinitialization of the components that I’m unaware of.
These are the articles I found here:
https://ask.embedded-wizard.de/7077/handleevent-missed-during-style-handling
https://ask.embedded-wizard.de/143/changing-the-style-during-runtime?show=143#q143
https://ask.embedded-wizard.de/10233/about-refreshing-language-and-style?show=10235#a10235
Here are some screenshots :
Normal Look :

Desired Look

"In Between" look, here the style is set correctly but the Gui shows changes only after having touched the buttons

Thank you for reading
Dario.