Hello Naki,
InvalidateViewState() implements just a mechanism to update the state of a GUI component. It has primarily less to do with the screen update itself (if I understood your question correctly). The screen update is performed automatically when it is needed, so you don't need to worry about it.
Nevertheless, if you want to update the state a GUI component in response to state alternation within the firmware, you need to notify the GUI about this event. You have two possibilities to do this:
1. Send so-called System Event to the GUI. The GUI components can handle this event and update the state.
2. Use a Property to represent a data value (e.g. voltage, etc.) of the firmware. When the firmware updates this property, the GUI application is again notified.
For more details please see the chapter Implementing a Device Interface as well as the sub-ordinated chapters System Event and (Device Interface-) Property.
I hope it helps you further.
Best regards
Paul Banach